Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to launch the browser process! #14

Closed
MarcosGit opened this issue Nov 23, 2021 · 2 comments
Closed

Error: Failed to launch the browser process! #14

MarcosGit opened this issue Nov 23, 2021 · 2 comments

Comments

@MarcosGit
Copy link

Hi, i am in live site and after i followed this #8 i did this:

npm install -g puppeteer
npm link puppeteer

but when i use tinker: Spatie\Browsershot\Browsershot::url('https://nova.laravel.com')->save('test.pdf')

I get this error:

Symfony\Component\Process\Exception\ProcessFailedException with message 'The command "PATH=$PATH:/usr/local/bin NODE_PATH=npm root -g node '/var/www/dotorm.cv/releases/20211123160705/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"https://nova.laravel.com","action":"pdf","options":{"path":"test.pdf","args":[],"viewport":{"width":800,"height":600}}}'" failed.

Exit Code: 1(General error)

Working directory: /var/www/dotorm.cv/releases/20211123160705

Output:

Error Output:

Error: Failed to launch the browser process!
/usr/lib/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at onClose (/usr/lib/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:203:20)
at Interface.<anonymous> (/usr/lib/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:68)
at Interface.emit (events.js:388:22)
at Interface.close (readline.js:429:8)
at Socket.onend (readline.js:202:10)
at Socket.emit (events.js:388:22)
at endReadableNT (internal/streams/readable.js:1336:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)

Some one can help me pass this error, please (I get this error only on live site in my computer all is working good).

@Padocia
Copy link
Owner

Padocia commented Nov 24, 2021

Hi,
As you can see from the error, The provided chrome path doesn't exists, can you please check if /usr/lib/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome exists. if it doesn't exists you can manually install chromium on your server & set a Custom chrome/chromium executable path

@MarcosGit
Copy link
Author

@Padocia Thank you, you save my day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants