TypeError: Cannot read properties of undefined (reading 'options')

im not even sure what i did wrong lmao https://i.proxied.host/u/N7N6gq.png @ me when replying pls
Solution:
yall not gonna believe it but I deleted node_modules and reinstalled them and it's working now Kek
Jump to solution
6 Replies
Favna
Favna12mo ago
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?
Spinel
Spinel12mo ago
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.
Favna
Favna12mo ago
@djoh
djoh
djohOP12mo ago
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 easier
Solution
djoh
djoh12mo ago
yall not gonna believe it but I deleted node_modules and reinstalled them and it's working now Kek
Favna
Favna12mo ago
Probably out of sync dependency versions then.
Want results from more Discord servers?
Add your server