Problem with intents

Hello there. So, I just downloaded the new version of Discord.js, and I am surprised at how quickly I came across some errors. The first problem I came across was Intents.FLAGS being replaced. No problem there though, I quickly fixed that by replacing Intents.FLAGS with GatewayIntentBits. What is my problem? After doing that, it ended up giving me a RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined. error. Here are my intents:

const client = new DiscordJS.Client({
    intents: [
        GatewayIntentBits.GUILDS,
        GatewayIntentBits.GUILD_MESSAGES,
        GatewayIntentBits.GUILD_MEMBERS,
        GatewayIntentBits.GUILD_BANS,
        GatewayIntentBits.GUILD_EMOJIS_AND_STICKERS,
        GatewayIntentBits.GUILD_INTEGRATIONS,
        GatewayIntentBits.GUILD_WEBHOOKS,
        GatewayIntentBits.GUILD_INVITES,
        GatewayIntentBits.GUILD_VOICE_STATES,
        GatewayIntentBits.GUILD_PRESENCES,
        GatewayIntentBits.GUILD_MESSAGES,
        GatewayIntentBits.GUILD_MESSAGE_REACTIONS,
        GatewayIntentBits.GUILD_MESSAGE_TYPING,
        GatewayIntentBits.DIRECT_MESSAGES,
        GatewayIntentBits.DIRECT_MESSAGE_REACTIONS,
        GatewayIntentBits.DIRECT_MESSAGE_TYPING,
        GatewayIntentBits.GUILD_SCHEDULED_EVENTS
    ],
    partials: [
        "GUILD_MEMBER",
        "MESSAGE",
        "CHANNEL",
        "GUILD_SCHEDULED_EVENT",
        "REACTION",
        "USER"
    ]
})

If someone could help me, that would be awesome. Thank you for your time and help, it is truly appreciated.



Full error stack:
RangeError [BitFieldInvalid]: Invalid bitfield flag or number: undefined.
    at Function.resolve (C:\Users\Batman212369\Desktop\Discord Bots\Pin-Bot\node_modules\discord.js\src\util\BitField.js:168:11)       
    at C:\Users\Batman212369\Desktop\Discord Bots\Pin-Bot\node_modules\discord.js\src\util\BitField.js:163:54
    at Array.map (<anonymous>)
    at Function.resolve (C:\Users\Batman212369\Desktop\Discord Bots\Pin-Bot\node_modules\discord.js\src\util\BitField.js:163:40)       
    at new BitField (C:\Users\Batman212369\Desktop\Discord Bots\Pin-Bot\node_modules\discord.js\src\util\BitField.js:33:38)
    at new IntentsBitField (C:\Users\Batman212369\Desktop\Discord Bots\Pin-Bot\node_modules\discord.js\src\util\IntentsBitField.js:9:1)
    at Client._validateOptions (C:\Users\Batman212369\Desktop\Discord Bots\Pin-Bot\node_modules\discord.js\src\client\Client.js:482:25)
    at new Client (C:\Users\Batman212369\Desktop\Discord Bots\Pin-Bot\node_modules\discord.js\src\client\Client.js:78:10)
    at Object.<anonymous> (C:\Users\Batman212369\Desktop\Discord Bots\Pin-Bot\bot.js:24:16)
    at Module._compile (node:internal/modules/cjs/loader:1105:14) {
  code: 'BitFieldInvalid'
}

Discord.js Version: 14.6.0
Node Version: 8.1.4
Was this page helpful?