puppeteer-heroku-buildpack: Error: Could not find Chrome (ver. 112.0.5615.121).
Folks, any ideas? I already cleared Heroku build cache as instructed in the README file. And I’m running this via Heroku Scheduler. But I keep receiving an error like:
Error: Could not find Chrome (ver. 112.0.5615.121).
Here is some evidence…
From package.json:
"puppeteer": "^20.0.0",
"puppeteer-extra": "^3.3.6",
Here’s my launch:
const { executablePath: puppeteerExecutablePath } = require("puppeteer");
const puppeteer = require("puppeteer-extra");
// ...
puppeteer.launch({
{ headless: true },
args: [
"--disable-gpu",
"--disable-dev-shm-usage",
"--disable-setuid-sandbox",
"--no-sandbox",
"--single-process",
"--incognito",
"--no-zygote",
],
executablePath: puppeteerExecutablePath(),
});
And the error:
2023-05-08T15:03:15.998557+00:00 app[scheduler.2244]: Error: Could not find Chrome (ver. 112.0.5615.121). This can occur if either
2023-05-08T15:03:15.998557+00:00 app[scheduler.2244]: 1. you did not perform an installation before running the script (e.g. `npm install`) or
2023-05-08T15:03:15.998557+00:00 app[scheduler.2244]: 2. your cache path is incorrectly configured (which is: /app/.cache/puppeteer).
2023-05-08T15:03:15.998559+00:00 app[scheduler.2244]: For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.
2023-05-08T15:03:15.998560+00:00 app[scheduler.2244]: at ChromeLauncher.resolveExecutablePath (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:301:27)
2023-05-08T15:03:15.998575+00:00 app[scheduler.2244]: at ChromeLauncher.executablePath (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:183:25)
2023-05-08T15:03:15.998575+00:00 app[scheduler.2244]: at PuppeteerNode.executablePath (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/PuppeteerNode.js:155:105)
2023-05-08T15:03:15.998575+00:00 app[scheduler.2244]: at launchBrowser (/app/seeker/scraper.js:130:25)
2023-05-08T15:03:15.998576+00:00 app[scheduler.2244]: at /app/seeker/scraper.js:35:15
2023-05-08T15:03:15.998577+00:00 app[scheduler.2244]: at promiseResultMonad (/app/seeker/scraper-fp-helpers.js:41:12)
2023-05-08T15:03:15.998577+00:00 app[scheduler.2244]: at scrapProcessesData (/app/seeker/scraper.js:34:61)
2023-05-08T15:03:15.998577+00:00 app[scheduler.2244]: at /app/seeker/index.js:50:9
2023-05-08T15:03:15.998577+00:00 app[scheduler.2244]: at processTicksAndRejections (node:internal/process/task_queues:96:5)
2023-05-08T15:03:15.998578+00:00 app[scheduler.2244]: }
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 18 (3 by maintainers)
I took a look at the source code of
https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/google-chrome.tgz
It’s exactly the same as what you get from
https://github.com/heroku/heroku-buildpack-google-chrome
, not sure why the stack overflow answer author would have used that url instead of the one you get from the official heroku buildpack registry but it works the same and using the official url instead is likely best practice.Regression testing complete, this buildpack only works up to
puppeteer ~18
. On>=19
you’re going to get the error that kicked off this issue originally.The new buildpack using the official url
https://github.com/heroku/heroku-buildpack-google-chrome
is working for me on all puppeteer versions13
-20
although you must follow all the instructions.Figured it out. Newer versions of
puppeteer
require a different buildpack (https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/google-chrome.tgz
) in order to work on herokuStackoverflow post for slug size issue that solved it for me
@Mazuh
Looks like in
puppeteer@18
it’s got some new caching mechanics with chromeRelevant issues: 9192 9533
We unfortunately had to downgrade our app’s use of puppeteer to version 13 in order to avoid this issue. That’s the best we were able to come up with for now. Even tried a
postinstall
script in ourpackage.json
but for some reason when you remote into your dyno the.cache
folder is nowhere to be found.Also note that with additonal steps like this performed directly on the dyno your manual changes might be shaken off due to its ephemeral-filesystem