My app is working on localhost but when i deploy on heroku this module is required for puppeteer app https://github.com/jontewks/puppeteer-heroku-buildpack. puppeteer node_module size is around 300mb and this module size is 200.Total size is 539mb. Please suggest a good solution
Faced the same issue.
The following steps reduced my slug size from around 530MB to around 250MB.
1 — Update buildpacks
Add the heroku/google-chrome
buildpack. Place it above the heroku/nodejs
buildpack. The jontewks/puppeteer-heroku-buildpack
is not required here anymore.
2 — Add new ENV variables
Add PUPPETEER_EXECUTABLE_PATH. In your local environment, set this env variable as \path\to\chrome.exe
. In Heroku, set this env variable as google-chrome
.
Also add PUPPETEER_SKIP_DOWNLOAD, and set it to true
. This tells Puppeteer to skip downloading Chromium.
3 — Update Puppeteer config
Puppeteer's launch options includes executablePath
. Set this to PUPPETEER_EXECUTABLE_PATH.
4 — Deploy, you're done!
Push commit to Heroku to trigger new deployment. Hopefully, your slug size will have reduced by then, and your Heroku app should be able to deploy successfully.
© 2022 - 2024 — McMap. All rights reserved.