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
Error: Could not find Chrome (ver. 112.0.5615.121). #128
Comments
Well, the browser was indeed missing, so I created a bash script to fix it: #!/bin/bash
echo 'Preparing to run automation on production mode.'
puppeteer_cache_dir=".cache/puppeteer/chrome/"
puppeteer_dep_dir="node_modules/puppeteer/"
if [[ -d "$puppeteer_cache_dir" ]];
then
echo "$puppeteer_cache_dir directory exists."
else
echo "$puppeteer_cache_dir directory does not exist. Trying to re-install Puppeteer."
cd "$puppeteer_dep_dir"
npm install
fi
echo "Going back to original directory and running script now..."
cd
npm run my_puppeteer_routine_here But I wonder if I'm re-downloading something that already exists, it seems like a dumb use of resources. Any comments? |
@Mazuh Thanks very much for this script I have this exact same issue on It appears that the current version is not installing chrome for some reason. I also tried the |
Looks like in 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 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 |
which specific version of puppeteer did you revert it to @ironicbrew ? |
@CoolTechYT We went back to |
I was able to get it working using |
Less than We ended up with the same issue on |
Side effect of chromium balooning in size I believe Edit: Ah no wait that's a really old issue that's since been fixed. Maybe it's occured again though? |
Got it, I think the last working version (is there an acronym for this? I can't remember) is 18.1.0 |
Figured it out. Newer versions of Stackoverflow post for slug size issue that solved it for me |
@ironicbrew so we should use the AWS hosted buildpack instead of this repo? |
Depends on the version of puppeteer you want to use, I'm performing regression testing now to figure out what versions the newer buildpack works for and I'll put together a PR that'll update the README for this repo |
I took a look at the source code of It's exactly the same as what you get from Regression testing complete, this buildpack only works up to The new buildpack using the official url |
@ironicbrew Thank you! That worked for me 👍 |
Thanks for all this info y'all. If you're running into heroku slug size issues, you can use the no xdg-utils version of the buildpack which saves you a lot of space, but excludes one dependency. So far I've only heard of that causing an issue with PDF creation, but not sure what else that library is used for, but can be worth a shot. I'll peruse the new google chrome buildpack and see if there are changes I can pull in to resolve. That previously was causing an issue with size as puppeteer installs its own version of chrome as well. @ironicbrew are you removing this current buildpack and only adding the new chrome and its working? Whats the slug size like? Edit: I see the env variables in that link now, that makes sense. |
Its interesting that this is working since the packages installed by the google chrome buildpack don't include several that puppeteer specifically call out as required. I also recall running into an issue where puppeteer expected the bundled version of chromium when trying to use the buildpack installed one as they are different. Their list is here: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-doesnt-launch-on-linux Glad its working but there might be some issues that pop up in the future due to those things. I'll update the buildpack for whatever the issue is for puppeteer 20 though. |
Removed
We're using a rather narrow set of puppeteer features so maybe that's why we're getting away with it? |
I'm hoping that puppeteer just haven't updated that list in a while. Plus if xdg-utils is just pushing the whole thing over the total nowadays that chromium has become larger, there really is just no use. I matched the packages installed by the official chrome buildpack and its working once again. I'll be updating the readme with one postbuild command that needs to be run on heroku since the puppeteer installation of chrome is not bundled with the app due to a name collision otherwise I believe. |
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:
Here is some evidence...
From package.json:
Here's my launch:
And the error:
The text was updated successfully, but these errors were encountered: