I am using puppeteer chromium to scrape screenshots of websites on server side. It’s going well but seems to consume a lot of time for function, so I turned on fluid compute. But it causes errors on server when launching browser. Not sure what causes this because it works fine with fluid compute disabled
Browser launch attempt 1 failed: 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
Hello, the Puppeteer Chromium Library attempts to use an AWS-specific environment variable that has been disabled in the Fluid Compute environment. This is likely what’s causing the issue you’ve experienced.
As a quick solution, we suggest adding the environment variable AWS_LAMBDA_JS_RUNTIME=nodejs22.x to your project and redeploying it. This should rectify the problem you’ve been encountering.
Here’s how you can add this environment variable:
Open up your project settings.
Find the section labeled “Environment Variables”.
Click “Add new” and enter AWS_LAMBDA_JS_RUNTIME as the key and nodejs22.x as the value.