Discord bot on Heroku suddenly stopped working

My Discord bot was running fine on Heroku but now it won’t start anymore. I’m pretty new to using Heroku for hosting so I don’t really know what I’m doing wrong. I already tried redeploying from my GitHub repository but that didn’t fix anything.

Update: I checked the logs and here’s what I found:

Before trying to open the app:

2018-07-23T16:54:27.265702+00:00 app[worker.1]:     at Function.Module._load (module.js:497:3)
2018-07-23T16:54:27.265704+00:00 app[worker.1]:     at Function.Module.runMain (module.js:693:10)
2018-07-23T16:54:27.265705+00:00 app[worker.1]:     at startup (bootstrap_node.js:191:16)
2018-07-23T16:54:27.265707+00:00 app[worker.1]:     at bootstrap_node.js:612:3
2018-07-23T16:54:27.327613+00:00 heroku[worker.1]: State changed from up to crashed
2018-07-23T16:54:27.310511+00:00 heroku[worker.1]: Process exited with status 1

When I click Open App:

2018-07-23T16:58:44.866697+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=mybot.herokuapp.com request_id=b32a5f7d-157e-45a5-805b-8c306140d020 fwd="73.23.238.216" dyno= connect= service= status=503 bytes= protocol=https
2018-07-23T16:58:45.502353+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=mybot.herokuapp.com request_id=19e6fc48-37ed-48db-87f9-759d704ddb3e fwd="73.23.238.216" dyno= connect= service= status=503 bytes= protocol=https

Your logs indicate a module loading issue, likely due to an incorrect main entry point. I encountered a similar situation when I rearranged my bot files but neglected to update the start script in package.json. The worker dyno attempts to start your bot but fails due to a module-level error before reaching the Discord authentication stage. Verify that the main file path in your package.json aligns with your actual file structure, and ensure your Procfile directs to the correct entry file. Additionally, the H14 error you see when accessing ‘Open App’ is expected if your bot does not serve web content; you would need to implement a web server for that functionality.

hey! that H14 error means heroku can’t find any web processes runnning. check if your Procfile is in the root folder & make sure it’s set to ‘web’, not ‘worker’ - should fix the issue!

Those crash logs show a module loading error that’s happening before the H14 issue. Had the same thing last year - turned out to be a dependency problem. Check your package.json and make sure all dependencies are listed properly, especially if you updated packages recently. Run npm install locally to see if anything’s missing. When worker.1 crashes with exit status 1, it usually means your bot can’t start because of a missing import or config issue. Also double-check that your bot token’s still valid in your Heroku config vars.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.