puppeteer: [Bug]: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
Bug description
Hello -
I’m trying to run puppeteer in Google Cloud Functions, and getting the following error:
/workspace/.cache/puppeteer/chrome/linux-1069273/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
I have set .puppeteerrc.cjs
to the example value here - without this, the Chromium binary is not found.
Any help would be greatly appreciated. Thank you!
Puppeteer version
19.4.0
Node.js version
18
npm version
9.2.0
What operating system are you seeing the problem on?
Linux
Configuration file
No response
Relevant log output
/workspace/.cache/puppeteer/chrome/linux-1069273/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory9
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 17
The largest free portal, fast and user-friendly interface, unlimited data source. Zamona last and actual news, music, movies, videos, products, vacancies, photos, questions and answers https://zamona.net/en/
I also had this error when trying to upgrade to GCF Node 18 runtime. The Node 16 runtime works fine.
Here is the Google issue tracking this problem: https://issuetracker.google.com/266279679
None of the above solutions worked. I am trying to deploy to google cloud run but puppeteer is not working properly. Getting the same error “libnss3.so: cannot open shared object …”. Is there any solution about that?
It hasn’t been resolved at all. I’ve re-opened a new issue as a Bug instead of a Feature Request this time, as it’s been months and nothing has been done yet.
Upvotes are welcome: https://issuetracker.google.com/issues/278096732
@mgamini unfortunately, we have no control over the Google Could Functions environment. You could try using Google Cloud Run which allows providing a Dockerfile with all dependencies.
@CM96 Puppeteer has no means to install system dependencies to your host. So there is no another way. You can build your own browser binaries from source but that is arguably worse than installing dependencies for existing binaries.