puppeteer
puppeteer copied to clipboard
[Bug]: Failed to launch the browser process!
Bug description
Steps to reproduce the problem: I am having difficulty running puppeteer functions . I keep getting this error - (node:13460) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process! /node_modules/puppeteer/.local-chromium/linux-970485/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 (/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237:20) at Interface.helper_js_1.helper.addEventListener (/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:227:68) at Interface.emit (events.js:203:15) at Interface.close (readline.js:397:8) at Socket.onend (readline.js:173:10) at Socket.emit (events.js:203:15) at endReadableNT (_stream_readable.js:1145:12) at process._tickCallback (internal/process/next_tick.js:63:19) (node:13460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:13460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I have tried installing all dependencies and all 1000 resolutions to disable sandbox and what not but no luck , i will be really glad if you can help me out with this error resolution.
Puppeteer version
13.5.1
Node.js version
17.0.0
npm version
6.14.4
What operating system are you seeing the problem on?
Linux, Windows
Relevant log output
node:13460) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/node_modules/puppeteer/.local-chromium/linux-970485/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 (/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237:20)
at Interface.helper_js_1.helper.addEventListener (/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:227:68)
at Interface.emit (events.js:203:15)
at Interface.close (readline.js:397:8)
at Socket.onend (readline.js:173:10)
at Socket.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:13460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
We encounter this issue aswell, while using mermaid-cli version ^8.13.5
Stacktrace:
/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237
reject(new Error([
^
Error: Failed to launch the browser process!
/azp/_work/1/s/APIs/node_modules/puppeteer/.local-chromium/linux-970485/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 (/azp/_work/1/s/APIs/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237:20)
at Interface.<anonymous> (/azp/_work/1/s/APIs/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:227:68)
at Interface.emit (node:events:538:35)
at Interface.close (node:readline:586:8)
at Socket.onend (node:readline:277:10)
at Socket.emit (node:events:538:35)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237 reject(new Error([
Getting this anyone any luck so far ?
We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.
even i'm too facing the same error in Heroku
Same here on Netlify. It was working fine a couple of weeks ago.
Facing this issue too on Node 16 too using Puppeteer 16.1.0
Can't run my app in digital ocean "apps" because of this issue.
This issue indicates that your OS is missing the required dependencies for the Chromium binary. Please follow the troubleshooting.md guide linked in the error message to see which dependencies are missing.
Also please use our new Docker image that comes with the dependencies pre-installed https://github.com/puppeteer/puppeteer/pkgs/container/puppeteer
Hi @OrKoN unfortunately this would not work for me in my case as my Node image is provided by AWS Lambda. What would you advise in this situation?
@samdharris there are projects like chrome-aws-lambda that try to bundle all dependencies for AWS Lambda. In a nutshell, they built a custom chromium binary statically linking all dependencies https://github.com/alixaxel/chrome-aws-lambda/tree/master/_/ansible
same issue when using OS (local)
I have the same problem on Digital Ocean Apps, trying to fix it.
Any solution?
2023-03-13T19:07:22.571255562Z /workspace/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241
2023-03-13T19:07:22.571287294Z reject(new Error([
2023-03-13T19:07:22.571295988Z ^
2023-03-13T19:07:22.571301598Z
2023-03-13T19:07:22.571307148Z Error: Failed to launch the browser process!
2023-03-13T19:07:22.571313908Z /workspace/node_modules/whatsapp-web.js/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
2023-03-13T19:07:22.571320003Z
2023-03-13T19:07:22.571324374Z
2023-03-13T19:07:22.571329591Z TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
2023-03-13T19:07:22.571334192Z
2023-03-13T19:07:22.571339065Z at onClose (/workspace/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241:20)
2023-03-13T19:07:22.571349144Z at ChildProcess.<anonymous> (/workspace/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:232:79)
2023-03-13T19:07:22.571362012Z at ChildProcess.emit (node:events:525:35)
2023-03-13T19:07:22.571368445Z at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)