TypeError: Cannot read properties of undefined (reading 'options')
Solution:Jump to solution
yall not gonna believe it but I deleted node_modules and reinstalled them and it's working now
6 Replies
That means it is failing on
const { subcommandDefaultCooldown } = container.client.options;
which means that client
is undefined which is only possible if your commands are somehow being loaded before the client is properly initialised which is normally impossible. Something funky must be going on with your setup and it's hard to tell from this what. Maybe try looking at some the other bots using Sapphire, or generate your project using @sapphire/cli?Discord Bots using @sapphire/framework
v5.x
- Gemboard ᴱ ᴰ
- Dragonite ᴱ ᴰ
- Archangel ᴱ ᴰ
- Official Bot Examples ᴱ ᴰ ᴶˢ
v4.x
- Radon ᴱ ᴬ
- Sapphire Application Commands Examples ᴱ
- Zeyr ᴰ ᴬ
- Birthdayy ᴰ
- KBot ᴱ ᴬ ᴰ
- RTByte ᴱ ᴬ
Outdated bots / honourable mentions
- Skyra ᴬ ᴰ
Legend for the identifiers
ᴱ: Uses ESM (if not specified then uses CJS)
ᴬ: Advanced bot (if not specified it is a simple bot, or not graded)
ᴰ: Uses Docker in production
ᴶˢ: Written in JavaScript. If not specified then the bot is written in TypeScript.
@djoh
ill take a deeper look into load order tomorrow
the issue only happens when the command class extends Subcommand class. the moment I switch to extending normal Command class everything works just fine.
actually it only happens when I pass the
subcommands
property to options
if this makes it easierSolution
yall not gonna believe it but I deleted node_modules and reinstalled them and it's working now
Probably out of sync dependency versions then.