alixaxel / chrome-aws-lambda

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

Node 16.x is supported? #275

Open outaTiME opened 2 years ago

outaTiME commented 2 years ago

I am having the following error when I try to run my lambda with node 16.x, does anyone else get this?

 "Failed to launch the browser process!\n/tmp/chromium: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n"

Environment

bitconym commented 2 years ago

I see the fix is implemented and a pull request is made. Any reason why is not merged yet?

bktan81 commented 1 year ago

I've received an email from AWS that they are going to phase out the support of Nodejs12 end of 2022. I'm facing the same issue with Nodejs16 and waiting for the latest version of chrome-aws-lambda.

However, if you are looking for a temporary fix, just fake the AWS_EXECUTION_ENV, please make sure other libraries are not using the environment variable AWS_EXECUTION_ENV for anything.

exports.handler = async (_event, context, callback) => {
    //Fake the nodejs version
    process.env.AWS_EXECUTION_ENV = "AWS_Lambda_nodejs14.x";
    ...
pagameba commented 1 year ago

FYI https://github.com/shelfio/chrome-aws-lambda-layer has switched to https://github.com/Sparticuz/chrome-aws-lambda which supports nodejs16.x

experionsachin commented 1 year ago

The latest repository is https://www.npmjs.com/package/@sparticuz/chromium. Working well with node 18 and AWS Lambda.