TypeError: Cannot read properties of undefined (reading 'get')
the error is at line 3 here
5 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OP<Client>.commands
is not a native property, so you need to define it yourself
If you're following the discord.js official guide, you forgot to add the line client.commands = new Collection()
in your index.jsReferenceError: Collection is not defined
import it from discord.js
Thanks, that worked!