Open brickyang opened 11 months ago
Same issue🥲 no updates?
Did you check the troubleshooting section of Puppeteer documentation https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md? Since, I updated Puppeteer you might do some changes on your part. That is why I made a major version to warn about the fact it might contains breaking changes on puppeteer side.
I have been using node-html-to-image for two years and it worked well. Recently I updated all dependencies including this package to v4.0.0 and it doesn't work any more.
Call
nodeHtmlToImage()
it just thrown an error:I googled every error message, read many pages in GIthub and Stack Overflow and tried different version of nodejs and Chrome but got nothing.
Eventually I modified package.json with
node-html-to-image ^3
, gotERROR 54 nodejs.Error: Unable to launch browser, error message: Could not find expected browser (chrome) locally. Run
npm installto download the correct Chromium revision
.Then I run
node node_modules/puppeteer/install.js
and enerything is GOOD now.I have no idea what happened.
------ BACKGROUND ------
I use a Docker container to run my app. The base image is
node:20-bullseye-slim
and installed Chrome manually. My Dockerfile:My puppeteer args is: