Browsershot/Puppeteer works on Windows but fails on Laravel Forge (Ubuntu) — missing libatk-1.0.so.0 when launching chrome-headless-shell #961
AmeerHamza-FT
started this conversation in
Bugs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
CV/PDF generation works locally on Windows, but on a Laravel Forge server (Ubuntu) Browsershot fails to launch the bundled Puppeteer browser.
It crashes with: chrome-headless-shell: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory. This looks like the server image is missing required OS-level dependencies for Chromium/Puppeteer.
PDF generation fails with Puppeteer/Chromium launch error.
Error / Logs: {
"code": 500,
"error": "CV generation failed: The command "PATH=$PATH:/usr/local/bin:/opt/homebrew/bin NODE_PATH=
npm root -g"node" '/home/forge/kasova_job_backend-k9kx8iue.on-forge.com/releases/59747771/vendor/spatie/browsershot/src/../bin/browser.cjs' '{"url":"file:\/\/\/tmp\/331345986-0406510001764142414\/index.html","action":"pdf","options":{"path":"\/home\/forge\/kasova_job_backend-k9kx8iue.on-forge.com\/releases\/59747771\/storage\/app\/public\/pdfs\/cv_17_1764142414.pdf","args":["--no-sandbox","--disable-setuid-sandbox"],"viewport":{"width":800,"height":600},"displayHeaderFooter":false,"format":"A4","margin":{"top":"0mm","right":"0mm","bottom":"0mm","left":"0mm"},"printBackground":true}}'" failed.\n\nExit Code: 1(General error)\n\nWorking directory: /home/forge/kasova_job_backend-k9kx8iue.on-forge.com/releases/59747771/public\n\nOutput:\n================\n\n\nError Output:\n================\nError: Failed to launch the browser process: Code: 127\n\nstderr:\n/home/forge/.cache/puppeteer/chrome-headless-shell/linux-142.0.7444.175/chrome-headless-shell-linux64/chrome-headless-shell: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory\n\nTROUBLESHOOTING: https://pptr.dev/troubleshooting\n\n at ChildProcess.onClose (/home/forge/kasova_job_backend-k9kx8iue.on-forge.com/releases/59747771/node_modules/@puppeteer/browsers/lib/cjs/launch.js:340:24)\n at ChildProcess.emit (node:events:531:35)\n at ChildProcess._handle.onexit (node:internal/child_process:293:12)\n"}
Beta Was this translation helpful? Give feedback.
All reactions