Cannot read data and .toJSON
C:\Users\Bernardo\Desktop\berrie\main.js:37
for (const command of commands) { commandArray.push(client.commands.get(command).data.toJSON()); }
^
TypeError: Cannot read properties of undefined (reading 'data')
at client.pushcmds (C:\Users\Bernardo\Desktop\berrie\main.js:37:82)
at C:\Users\Bernardo\Desktop\berrie\dashboard\dash.js:35:30
at Layer.handle [as handle_request] (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\layer.js:95:5)
at next (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\route.js:149:13)
at Route.dispatch (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\route.js:119:3)
at Layer.handle [as handle_request] (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\layer.js:95:5)
at C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\index.js:284:15
at param (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\index.js:365:14)
at param (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\index.js:376:14)
at Function.process_params (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\index.js:421:3)
2 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 staffanyone able to help?
[email protected] C:\Users\Bernardo\Desktop\berrie
└── [email protected]
PS C:\Users\Bernardo\Desktop\berrie> node -v
v22.2.0
its solved! I've had some deleted cmd in guilds.json
but ty for the response!