1

I'm trying to deploy my pupetter project on Glitch. I set the nodejs engine: 16.x I set the "@sparticuz/chromium": "^113.0.1" version according to suggestions.

This is my package json :

{
  "name": "buysellpupetter",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@sparticuz/chrome-aws-lambda": "^17.1.3",
    "chrome-aws-lambda": "^10.1.0",
    "dotenv": "^16.0.3",
    "nodemon": "^2.0.22",
    "puppeteer": "^20.1.2",
    "puppeteer-core": "^20.2.0",
    "request": "^2.88.2"
  },
  "engines": {
    "node": "16.x"
  },
  "devDependencies": {
    "@sparticuz/chromium": "^113.0.1"
  }
}

And this is my source code:

const chromium = require("@sparticuz/chromium");
..
    const browser = await puppeteer.launch({
        ignoreDefaultArgs: ['--disable-extensions'],

        args: chromium.args,
        defaultViewport: chromium.defaultViewport,
        executablePath: await chromium.executablePath(),
        headless: chromium.headless,
      });
      const page = await browser.newPage();

When I run this code, I get this error:

TROUBLESHOOTING: https://pptr.dev/troubleshooting
    at Interface.onClose (/rbd/pnpm-volume/eb105cb7-194c-4b68-b434-9102fa0ffea3/node_modules/@puppeteer/browsers/lib/cjs/launch.js:262:24)
    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)
ERROR => Error: Failed to launch the browser process!
/tmp/chromium: /usr/lib/x86_64-linux-gnu/libnss3.so: version `NSS_3.30' not found (required by /tmp/chromium)

How can I solve this problem ?

hobik
  • 439
  • 4
  • 15
  • Does this answer your question? [/tmp/chromium: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory Vercel](https://stackoverflow.com/questions/66214552/tmp-chromium-error-while-loading-shared-libraries-libnss3-so-cannot-open-sha) – ponury-kostek May 15 '23 at 11:50
  • No, I chek before the openning topic so I changed engine to 16.x but it didnt work. – hobik May 15 '23 at 12:05
  • Did you manage to find a solution? – Mathomatic Jun 27 '23 at 01:37

0 Answers0