erikras / react-redux-universal-hot-example

A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform
MIT License
11.99k stars 2.5k forks source link

Heroku deploys fail with hard coded port #976

Open AndrewRayCode opened 8 years ago

AndrewRayCode commented 8 years ago

Heroku passes in a dynamic port to this project under process.env.PORT. When it's hard coded, the Heroku port (I believe) is ignored, and then Heroku tries to bind to the process under the port it expects, which nothing is running on, then eventually fails with

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
heroku[web.1]: Stopping process with SIGKILL
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: Process exited with status 137

Due to this commit:

https://github.com/erikras/react-redux-universal-hot-example/commit/3ec5ecb4a949c76d06da91d8a7688e8feefb3f48#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

Ping @trungtin and @quicksnap for merging https://github.com/erikras/react-redux-universal-hot-example/pull/966

This took me about 6 hours to debug :) Suggest rolling back change ASAP. I suspect many heroku deploys will fail with the latest version of this library using a hard coded port.

trungtin commented 8 years ago

Sorry for wasting your time :(. Maybe it's problem with better-npm-run when watch-client script not receive the env.PORT unless hard-coded, even when I put watch-client script after start-dev. Any suggestion ?

YuMS commented 8 years ago

This commit is causing webpack-dev-server running on the wrong port

==> 🚧 Webpack development server listening on port 30001