shelfio/chrome-aws-lambda-layer

missing `libnspr4.so`

Opened this issue · 4 comments

getting

/tmp/chromium: error while loading shared libraries: libnspr4.so: cannot open shared object file: No such file or directory

wanted to flag Sparticuz/chromium#343 as an issue i'm getting, in case the issue is actually in this library. going to build a layer without chrome-aws-lambda-layer to confirm it's not in this library (i don't think it is)

Hey, did you get a chance to validate this? Having the same issue on the Node 22 runtime (but not on 20.x)

here were my findings,

i tested it while bundling Sparticuz/chromium in the dependencies (not a layer, not in devDependencies) and it works fine with playwright. so it's either something wrong with the layer, or something else in my own personal stack, but either way is not a Sparticuz/chromium issue

i did not confirm the issue was in the layer, but if you are experiencing the issue too, then i think it's highly likely the problem is in the layer itself. the workaround i found is having Sparticuz/chromium be a dependency and not to use this layer.

I believe I've found the issue. Node 22 wasn't supported in @Sparticuz/chromium until v131.0.1
https://github.com/Sparticuz/chromium/releases/tag/v131.0.1

But the version of the lambda layer listed in the README (50 for every region except ap-northeast-2) is for the release before this v131.0.0

This repo is set to automatically publish new versions of the layer when @Sparticuz/chromium updates but for some reason the job that is supposed to update the README is failing. See here
https://github.com/shelfio/chrome-aws-lambda-layer/actions/runs/13643344575/job/38137609997

Appears to be an issue in the sed command. Best guess is that list-layer-versions command is returning something unexpected.

The good news is that it's only the job to update the README that is failing. The new layer versions are still getting published. So you should be able to use the layer with the node 22 runtime if you use a more recent layer version. (53 is currently the latest version for every region except ap-northeast-2 which is always one version behind)

incredible, what a find