I am trying to run a node.js app on heroku. I got it working local, but when i deploy it on heroku i get the following error:
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
This is the port i try to listen to:
const PORT = process.env.port || 3000;
When i logged what the process.env.port was it said process.env.port was undefined.
Is there anything i need to do to automatically set the port?
Edit (FIX): So i found out where the problem was. The javascript was being minified, but the process.env.port was minified to something that didn't work. Thanks for the help.
for any one get to that post.
first check if you are writing process.env.PORT
correctly.
I was writing .Port
and it took 4 hours of my life to figure out the error
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With