Puppeteer errors when fluid compute is enabled

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:

  1. Open up your project settings.
  2. Find the section labeled “Environment Variables”.
  3. Click “Add new” and enter AWS_LAMBDA_JS_RUNTIME as the key and nodejs22.x as the value.
  4. Save your changes and redeploy your project.
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.