Today (7.8.2021) Discord.js v13 has been released. So I upgraded my previous Discord.js installation with
npm i discord.js@latest
and then adapted my basic index.js file to this state (I followed the Discord.js Guide):
const { Client, Intents } = require("discord.js");
const client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
});
client.once("ready", () => {
console.log("Ready!");
});
client.login("my-token");
However when I try to run my code I keep getting this error:
$ node .
(node:11216) UnhandledPromiseRejectionWarning: ReferenceError: AbortController is not defined
at RequestHandler.execute (C:\pathTo\node_modules\discord.js\src\rest\RequestHandler.js:172:15)
I've been working with Discord.js since 2018, hence I was astonished that I was having trouble with the new release. Is this an issue with the Discord.js v13 library? If not how can I fix the error?