0

I have recently update my Discord Bot code from js v12 to v13 and my node.js is up to date. I'm running my Bot on Heroku and when i push new changes, the error pops up saying UnhandledPromiseRejectionWarning: ReferenceError: AbortController is not defined. When i check my node version in VS Code, it says v16.7.0 but in heroku log says, v14.17.5. The code works fine when ran from VS Code

Discord.js Version: v13.0.1
Node.js Version: v16.7.0

Angel
  • 7
  • 1
  • Does this answer your question [Why am I getting a ReferenceError: AbortController is not defined in Discord.js v13?](https://stackoverflow.com/questions/68693319/why-am-i-getting-a-referenceerror-abortcontroller-is-not-defined-in-discord-js)? – Behemoth Aug 19 '21 at 12:06
  • Nope. I already have the latest version of node.js and djs. Everything works fine til i push this changes to heroku. In heroku log, it says im not using the latest version of node.js but in reality im – Angel Aug 19 '21 at 12:08
  • Are you able to log into Heroku and verify that the file that contains your Controller is indeed present? – faso Aug 19 '21 at 12:26
  • @faso Yes, i can log in to my Heroku but how do i verify? – Angel Aug 19 '21 at 12:39
  • Have you tried: https://stackoverflow.com/a/68705951/5648954 – Nick Parsons Aug 20 '21 at 05:07

1 Answers1

0

For Discord.js V13 u need the current Node.js version (v16.7.0), but Heroku will automatically take Node.js v14.17.5 if you didn't include an 'engines' tag in your package.json, from which it can get your desired node.js version.

You can pass this tag in your package.json like this:

  "engines": {
    "node": "16.7.0"
  }

More information: here

Iliannnn
  • 128
  • 5