Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
462 views
in Technique[技术] by (71.8m points)

Heroku gives error when trying to run my node.js discord bot

When running my bot through vsc it runs fine with no errors, once I uploaded to heroku for hosting purposes, I set my config vars as neeeded, but when starting the dynos I get hit with this error, not sure why it can't find the command handler as it works fine when running locally. Any help would be great, first time trying to host through heroku so maybe I did something wrong.

2021-01-29T00:10:59.407833+00:00 heroku[Worker.1]: Process exited with status 1
2021-01-29T00:10:59.444041+00:00 heroku[Worker.1]: State changed from up to crashed
2021-01-29T00:10:59.451018+00:00 heroku[Worker.1]: State changed from crashed to starting
2021-01-29T00:10:59.357002+00:00 app[Worker.1]: internal/modules/cjs/loader.js:818
2021-01-29T00:10:59.357022+00:00 app[Worker.1]:   throw err;
2021-01-29T00:10:59.357023+00:00 app[Worker.1]:   ^
2021-01-29T00:10:59.357023+00:00 app[Worker.1]: 
2021-01-29T00:10:59.357024+00:00 app[Worker.1]: Error: Cannot find module './handlers/command_handler'
2021-01-29T00:10:59.357024+00:00 app[Worker.1]: Require stack:
2021-01-29T00:10:59.357025+00:00 app[Worker.1]: - /app/main.js
2021-01-29T00:10:59.357025+00:00 app[Worker.1]:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
2021-01-29T00:10:59.357030+00:00 app[Worker.1]:     at Function.Module._load (internal/modules/cjs/loader.js:667:27)
2021-01-29T00:10:59.357030+00:00 app[Worker.1]:     at Module.require (internal/modules/cjs/loader.js:887:19)
2021-01-29T00:10:59.357031+00:00 app[Worker.1]:     at require (internal/modules/cjs/helpers.js:74:18)
2021-01-29T00:10:59.357031+00:00 app[Worker.1]:     at /app/main.js:11:5
2021-01-29T00:10:59.357032+00:00 app[Worker.1]:     at Array.forEach (<anonymous>)
2021-01-29T00:10:59.357032+00:00 app[Worker.1]:     at Object.<anonymous> (/app/main.js:10:38)
2021-01-29T00:10:59.357032+00:00 app[Worker.1]:     at Module._compile (internal/modules/cjs/loader.js:999:30)
2021-01-29T00:10:59.357033+00:00 app[Worker.1]:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
2021-01-29T00:10:59.357033+00:00 app[Worker.1]:     at Module.load (internal/modules/cjs/loader.js:863:32) {
2021-01-29T00:10:59.357034+00:00 app[Worker.1]:   code: 'MODULE_NOT_FOUND',
2021-01-29T00:10:59.357034+00:00 app[Worker.1]:   requireStack: [ '/app/main.js' ]
2021-01-29T00:10:59.357034+00:00 app[Worker.1]: }
question from:https://stackoverflow.com/questions/65947100/heroku-gives-error-when-trying-to-run-my-node-js-discord-bot

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...