Puppeteer/Chromium fails to launch: “Syntax error: word unexpected (expecting ‘)’)” on Laravel Forge #933
jonaspauleta
started this conversation in
Bugs
Replies: 1 comment 1 reply
-
|
I am getting the similar error on ARM architecture. Works fine on non-arm servers. Chrome version which fails Chrome version which works fine |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
As it is suggested on the Browsershot documentation, I did the following to setup my Laravel Forge server for Browsershot.
`
Check if node and npm are installed
node -v && npm -v
Install puppeteer
sudo npm install -g puppeteer
Install chromium
npx puppeteer browsers install chrome
Install dependencies
sudo apt update
sudo apt install libx11-xcb1 libxcomposite1 libasound2t64 libatk1.0-0 libatk-bridge2.0-0 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 `
And this is the error I am getting
[2025-04-30 10:08:26] debug.ERROR: Error generating PDF: The command "PATH=$PATH:/usr/local/bin:/opt/homebrew/bin NODE_PATH=npm root -g` node '/home/forge/********/vendor/spatie/browsershot/src/../bin/browser.cjs' '{"url":"file:///tmp/1096787838-0270654001746007705/index.html","action":"pdf","options":{"path":"/tmp/1712407904-0257426001746007705/*******.pdf","args":[],"viewport":{"width":800,"height":600},"displayHeaderFooter":false,"format":"a4","printBackground":true}}'" failed.Exit Code: 1(General error)
Working directory: /home/forge/*******
Output:
Error Output:
Error: Failed to launch the browser process!
/home/forge/.cache/puppeteer/chrome-headless-shell/linux_arm-135.0.7049.95/chrome-headless-shell-linux64/chrome-headless-shell: 35: Syntax error: word unexpected (expecting ")")
TROUBLESHOOTING: https://pptr.dev/troubleshooting
`
The AWS EC2 instance ia a t4g.small, so it is ARM
Running Ubuntu 24.04
Node v22.15.0
NPM 11.3.0
Any ideas?
Any work arrounds?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions