Error with Action (.\node_modules\discord.js\src\client\actions\ActionsManager.js:75)

When I run node index.js, my console shows TypeError: Action is not a constructor which is in the source files of discord.js. The ActionsManager.js file from the Discord.js library, an attempt is made to use Action as a constructor, but it is found that Action is not a valid constructor function. And the console also tells me that the error is related with const client = new Client({ intents: [GatewayIntentBits.Guilds] });.
It started when I was following this part of the documentation: https://discordjs.guide/additional-features/cooldowns.html. This is the error. (ActionManager.js)
register(Action) {
    this[Action.name.replace(/Action$/, '')] = new Action(this.client);
  }
Capture_decran_2023-07-06_105642.png
Was this page helpful?