My Discord bot crashes immediately after starting on Heroku with a CLIENT_MISSING_INTENTS error. Here’s what I see in the logs:
2021-08-15T11:25:42.158234+00:00 heroku[worker.1]: Starting process with command `node index.js`
2021-08-15T11:25:42.842156+00:00 heroku[worker.1]: State changed from starting to up
2021-08-15T11:25:45.234891+00:00 heroku[worker.1]: Process exited with status 1
2021-08-15T11:25:45.298445+00:00 heroku[worker.1]: State changed from up to crashed
2021-08-15T11:25:45.156773+00:00 app[worker.1]: /app/node_modules/discord.js/src/client/Client.js:544
2021-08-15T11:25:45.156789+00:00 app[worker.1]: throw new TypeError('CLIENT_MISSING_INTENTS');
2021-08-15T11:25:45.156790+00:00 app[worker.1]: ^
2021-08-15T11:25:45.156790+00:00 app[worker.1]:
2021-08-15T11:25:45.156791+00:00 app[worker.1]: TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
2021-08-15T11:25:45.156791+00:00 app[worker.1]: at Client._validateOptions (/app/node_modules/discord.js/src/client/Client.js:544:13)
2021-08-15T11:25:45.156792+00:00 app[worker.1]: at new Client (/app/node_modules/discord.js/src/client/Client.js:73:10)
2021-08-15T11:25:45.156792+00:00 app[worker.1]: at Object.DiscordBot.createBot (/app/index.js:41:15)
2021-08-15T11:25:45.156793+00:00 app[worker.1]: at Object.DiscordBot.start (/app/index.js:28:9)
2021-08-15T11:25:45.156793+00:00 app[worker.1]: at Object.<anonymous> (/app/index.js:1205:7)
The bot works fine locally but keeps crashing on Heroku. What could be causing this intents error during deployment?