Deploying Discord.js Bot to Heroku: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
Here’s how I solved it
Cause
When a Heroku app starts, it will dynamically bind a port for you. However, your Discord.js bot doesn’t listen to any port.
How to solve it
- Create a new file named
Procfile
to the root directory of your node project.
- Add the below line to
Procfile
and save the file. (Replace the script to how you start the app)
worker: npm start
Push it to Heroku.
Disable
web
and enableworker
in Heroku App > Resources Tab.
- The app should restart and work well.
有任何問題都歡迎在底下留言問我!如果我的文章有幫助到你的話,請你考慮幫我免費多按幾個讚喲 *(*´∀`*)☆