App crashed after deployed on Heroku. But it's working in my local.
See original GitHub issueI just installed this project on my local and deploy it on heroku.
It is working on my local, but crashed on heroku.
2017-08-25T06:30:25.001177+00:00 app[web.1]: > VuePack is running at http://localhost:4000 2017-08-25T06:30:25.001179+00:00 app[web.1]: 2017-08-25T06:31:06.348236+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2017-08-25T06:31:06.348326+00:00 heroku[web.1]: Stopping process with SIGKILL 2017-08-25T06:31:06.564701+00:00 heroku[web.1]: Process exited with status 137 2017-08-25T06:31:06.578860+00:00 heroku[web.1]: State changed from starting to crashed 2017-08-25T06:35:36.332773+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=webber.herokuapp.com request_id=b2434d56-7222-46e4-822b-11440bbc94a3 fwd="118.163.202.115" dyno= connect= service= status=503 bytes= protocol=https 2017-08-25T06:35:37.269529+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=webber.herokuapp.com request_id=de3f5728-b7d5-4c61-a3e0-4bd2e9911bf1 fwd="118.163.202.115" dyno= connect= service= status=503 bytes= protocol=https
Issue Analytics
- State:
- Created 6 years ago
- Comments:17
Top GitHub Comments
https://stackoverflow.com/questions/15693192/heroku-node-js-error-web-process-failed-to-bind-to-port-within-60-seconds-of
within server.js change the last line to
server.listen(process.env.PORT || port)
THIS SOLUTION IS FOR GO When you deploy an app through heroku, it does not allow you to specify the port number.
In other words, you can not specify your web service’s port number as 8000 or something else, heroku decides the port number in runtime.
so, you can not use the following code:
What you can do is, getting the runtime port of heroku.
In short, just use the following code: