Search code examples
node.jsherokupurescript

NodeJS app failed with "Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch"


I am getting error saying Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch when I try to start the app, I am pretty sure I've configured the app to use the $PORT env variable provided by Heroku, as I could see the line saying Server running on 38594 in the log, the port will change every time I restarted the dyno, I tried to login bash with heroku run bash and start the app from within there with node dist/bundle/index.js, and it works without any error, but I could still not open the app from browser, could someone help to point me to the right direction? cheers


Solution

  • Turns out HTTPure was trying to bind to localhost, while Heroku allows 0.0.0.0 instead of localhost. The most confusing part is the master branch of HTTPure is binding to 0.0.0.0 https://github.com/cprussin/purescript-httpure/blob/master/src/HTTPure/Server.purs#L84 while the released version I am using is binding to localhost, the fix is to use serve' with 0.0.0.0 to bind to the correct hostname