I am trying to get Puppeteer to work on AWS Lambda through a Docker image building in .NET Core 7.
I’m using the PuppeteerSharp library (https://www.puppeteersharp.com/).
My code runs fine in Visual Studio (both directly on my machine and in a Docker container). However, when I deploy to AWS Lambda, I get the following error:
Failed to launch browser! /tmp/Chrome/Linux-128.0.6613.119/chrome-linux64/chrome: error while loading shared libraries: libdbus-1.so.3: cannot open shared object file: No such file or directory
I’ve read just about every post on StackOverflow and other internet resources to try and resolve it. And tried installing from the DockerFile or directly at runtime (or both) – with no success.
I’ve also tried changing the location of the installation as I know Lambda can be protective of some locations in the file system. That created a different error, but no more successful.
The DockerFile includes the following line to specifically install the missing dependency (and also installs all the others I can find listed anywhere):
RUN sudo apt-get install -y libdbus-1-3 libdbus-1-3:amd64
Yet I still get the error when it tries to run.
Help!