-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Could not find Chrome (ver. ${this.puppeteer.browserRevision}) on Docker #12332
Comments
This issue has an invalid Node.js version: |
you need to run installation after your copied the config into the project folder |
So probably
would work. |
Thank you so much for looking into this @OrKoN. Unfortunately, moving the install after the copy command didn't change anything. Generally, I think it has to do with the way the chrome browser is resolved in the docker environment (vs my normal running application). Here are a couple of reasons I think so
But I still can't figure out why it would find it in a docker environment |
@vickonrails perhaps you need to make sure your local node_modules do not get copied to the Dockerfile cause in that case npm install might not install Puppeteer. |
finds the binary. Probably, after that it will fail to launch but to solve this see the official dockerfile we provide https://github.com/puppeteer/puppeteer/blob/main/docker/Dockerfile which has Puppeteer and the browser pre-installed. |
If anyone runs into this, I solved this by installing chrome manually. Here's what my # I'm using bun but you can replace with node
FROM oven/bun
# manually download chromium and some fonts. It's important to know the package manager your base image uses.
# In this case `oven/bun` is based on debian and apt-get is the package manager
RUN apt-get update && apt-get install -y \
fonts-dejavu fonts-droid-fallback fonts-freefont-ttf fonts-liberation \
chromium \
&& rm -rf /var/lib/apt/lists/*
# set the executable path and tell puppeteer to not download chromium
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
WORKDIR /usr/src/app
COPY package*.json ./
COPY . .
# Install after copying the files
RUN bun install
ENV NODE_ENV production
CMD [ "bun", "start" ] I hope this helps someone |
Minimal, reproducible example
Error string
Could not find Chrome (ver. ${this.puppeteer.browserRevision})
Bug behavior
Background
An API in my Node project exposes a route that accepts HTML in the body. This markup is used alongside some CSS to generate a PDF and send a buffer back as a response.
NB: I was previous using Bun, but I switched to node to make sure it wasn't a problem with bun.
Here's my docker file
I made a repro here
Expectation
The endpoint returns a PDF when running in a docker container as it works when running normally as a node app.
Reality
This works when I run as a node app, but when I try to run in a docker container, it gives the following error
Could not find Chrome (ver. 124.0.6367.60). This can occur if either
npx puppeteer browsers install chrome
) orPuppeteer configuration file (if used)
Puppeteer version
"puppeteer": "^22.7.1"
Node version
"node":"^21.1.0"
Package manager
yarn
Package manager version
1.22.19
Operating system
macOS
The text was updated successfully, but these errors were encountered: