My Themes Cafe
My Themes Cafe

Reputation: 97

Getting Error on Heroku. Failed to launch chrome

2019-12-06T16:09:57.053282+00:00 app[web.1]: Error: Failed to launch chrome!
2019-12-06T16:09:57.053298+00:00 app[web.1]:
2019-12-06T16:09:57.053301+00:00 app[web.1]: (chrome:44): Gtk-WARNING **: 16:09:57.031: cannot open display:
2019-12-06T16:09:57.053303+00:00 app[web.1]:
2019-12-06T16:09:57.053305+00:00 app[web.1]:
2019-12-06T16:09:57.053308+00:00 app[web.1]: TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
2019-12-06T16:09:57.053310+00:00 app[web.1]:
2019-12-06T16:09:57.053312+00:00 app[web.1]: at onClose (/app/node_modules/puppeteer/lib/Launcher.js:348:14)
2019-12-06T16:09:57.053314+00:00 app[web.1]: at ChildProcess. (/app/node_modules/puppeteer/lib/Launcher.js:338:60)
2019-12-06T16:09:57.053317+00:00 app[web.1]: at ChildProcess.emit (events.js:215:7)
2019-12-06T16:09:57.053319+00:00 app[web.1]: at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
2019-12-06T16:10:26.921203+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/product/new?search=https%3A%2F%2Fwww.walmart.com%2Fip%2FHamilton-Beach-Set-n-Forget-6-Quart-Slow-Cooker-Model-33969%2F16913518" host=arcane-wave-04024.herokuapp.com request_id=34a979c5-a553-4ba2-b233-af91b577d74a fwd="124.29.252.211" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https

I got this error. I have already setup following: puppeteer.launch({ args: ['--no-sandbox'] });

Added: https://github.com/jontewks/puppeteer-heroku-buildpack to Buildpacks.

Can any one help me out in this. Code was working fine on local host. But when I deploy it on heroku, it gives this error constantly.

Upvotes: 3

Views: 1435

Answers (2)

Agha Ali Abbas
Agha Ali Abbas

Reputation: 195

I was having the same issue with puppeteer and Heroku. I installed the same build pack which you have mentioned and i used the following code and now its working fine.

puppeteer.launch({headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox']})

P.S : I deployed again after installing build pack.

Upvotes: 3

Josiah Arkson
Josiah Arkson

Reputation: 61

Adding this github repo to my heroku buildpack worked for me

https://github.com/jontewks/puppeteer-heroku-buildpack

enter image description here

Upvotes: 0

Related Questions