react-snap: Unable to deploy to Heroku with create-react-app-buildpack
When deploying I am getting this error, which actually seems to freeze the build process on Heroku:
(node:629) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to launch chrome!
/tmp/build_2e66391b352738bb3c9a1b44c5632458/jesshmusic-living_music_database-ca09d15273a13f10f1a1a9e7ffd147503a55dc26/node_modules/react-snap/node_modules/puppeteer/.local-chromium/linux-499413/chrome-linux/chrome: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
(node:629) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I have attempted to add the puppeteer build pack as described in the troubleshooting link above but it doesn’t do any good. Does anyone have a solution to get this to deploy in Heroku? If it is something I missed in the docs kindly point me in that direction.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (9 by maintainers)
I’m surprised that following code didn’t help you. But you figured it out anyway so 👍
Main part of the log which you want to pay attention is:
Did you add react-snap to the dependencies? If issue is not solved, please open new ticket (to not spam people in this thread) and post contents of package.json
This is what I got
I guess you need
heroku config:set NPM_CONFIG_PRODUCTION=false, because react-snap listed as devDependecy.About issue with
libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directoryyou need to ask injontewks/puppeteer-heroku-buildpack. It was working sometimes ago.@jamez14 yes my example worked. You can clone repo, checkout branch and try it. I didn’t push it to the master because Heroku uses HTTP1.
Pagerror - means that error happened inside the headless browser, what would you see in DevTools in chrome. Try build with react-snap, to see if this Heroku specific or not. You can open separate issue if you can provide reproducible demo, otherwise I can not do much about it