chrome-aws-lambda icon indicating copy to clipboard operation
chrome-aws-lambda copied to clipboard

[BUG] Does Not Work With Node 16 or 18

Open CatfishKrenzer opened this issue 2 years ago • 10 comments

Environment

  • chrome-aws-lambda Version: latest
  • puppeteer / puppeteer-core Version:
  • OS:
  • Node.js Version: 16.x and 16.x
  • Lambda / GCF Runtime: Lambda nodejs16.x / nodejs18.x

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

CatfishKrenzer avatar Sep 05 '23 23:09 CatfishKrenzer

yes getting same issue

sumilraweng avatar Sep 06 '23 11:09 sumilraweng

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

veloware avatar Sep 07 '23 16:09 veloware

getting same issue

fuchengli1024 avatar Oct 17 '23 06:10 fuchengli1024

Any update planned?

8maxxam8 avatar Nov 23 '23 09:11 8maxxam8

Use @sparticuz/chromium

talaikis avatar Nov 28 '23 05:11 talaikis

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

vsateesh86 avatar Jan 30 '24 12:01 vsateesh86

@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?

8maxxam8 avatar Feb 12 '24 15:02 8maxxam8

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

sripraveens avatar Feb 20 '24 09:02 sripraveens

@sripraveens yes I am using node20 runtime!

8maxxam8 avatar Feb 20 '24 10:02 8maxxam8

@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

sripraveens avatar Feb 20 '24 10:02 sripraveens