alixaxel / chrome-aws-lambda

Chromium Binary for AWS Lambda and Google Cloud Functions
MIT License
3.17k stars 289 forks source link

[BUG] Does Not Work With Node 16 or 18 #299

Open CatfishKrenzer opened 10 months ago

CatfishKrenzer commented 10 months ago

Environment

Expected Behavior

Current Behavior

Not supported in Node 16 or Node 18

Error Stack

INFO Error: Failed to launch the browser process!/tmp/chromium: 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 (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:197:20)
at Interface. (/var/task/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:187:68)
at Interface.emit (node:events:526:35)
at Interface.close (node:internal/readline/interface:533:10)
at Socket.onend (node:internal/readline/interface:259:10)
at Socket.emit (node:events:526:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Possible Solution

sumilraweng commented 10 months ago

yes getting same issue

veloware commented 10 months ago

https://github.com/alixaxel/chrome-aws-lambda/issues/282

fuchengli1024 commented 8 months ago

getting same issue

8maxxam8 commented 7 months ago

Any update planned?

talaikis commented 7 months ago

Use @sparticuz/chromium

vsateesh86 commented 5 months ago

Using this @sparticuz/chromium also getting same error. Could you please let me know any other solution for this.

8maxxam8 commented 4 months ago

@vsateesh86 Same on my side!

@talaikis I switched to @sparticuz/chromium, but after launching the browser the rest of the code is not exectuted as expected. The lambda runs into a timeout even though it is set to 60 seconds. When I used "chrome-aws-lambda" the code was working as expected. Any idea what might cause this?

EDIT After updating the lambda node version to 20x the browser is launching as expected. The only issue I currently see is that the loading time is much longer than before. While my setup used to take like 25 seconds, it now takes around 50 seconds without major changes...

Which Lambda memory size do you recommend?

sripraveens commented 4 months ago

@8maxxam8 Which version of chrome-aws-lamda and puppeteer core you are using in the node20 runtime?

8maxxam8 commented 4 months ago

@sripraveens yes I am using node20 runtime!

sripraveens commented 4 months ago

@8maxxam8 Sorry I meant, which version of chrome-aws-lamda and puppeteer core you are using?

Because I was using the later version in node v14, now since v14 is not supported in lamda, In v20 this is not working for me