undefined error reading name

my commandhandler cant read properties of undefined it says...
36 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
grass
grass2y ago
show the error
mert
mertOP2y ago
treble/luna
treble/luna2y ago
Show the code
Syjalo
Syjalo2y ago
#how-to-get-help
mert
mertOP2y ago
mert
mertOP2y ago
I was getting to that just tried snipping my code
treble/luna
treble/luna2y ago
One or more commands do not have a data property
mert
mertOP2y ago
hmm however, if i comment out one of commands called update.js the bot suddenly starts working?
treble/luna
treble/luna2y ago
Then that command does not have a data property
mert
mertOP2y ago
treble/luna
treble/luna2y ago
console.log the file it returns
mert
mertOP2y ago
sure
treble/luna
treble/luna2y ago
also i hope you do not run that code on every start?
mert
mertOP2y ago
nah i just reload doesnt seem to work the code doesnt execute
treble/luna
treble/luna2y ago
what code? The console.log? It should execute if you put it before you access .name
mert
mertOP2y ago
owh you meant like that lmao yeah doesnt work well now it appears that the update.js file isnt even related wtf istg i didnt touch anything
treble/luna
treble/luna2y ago
Just check for a .data property on every file and console.log whenever a file does not have it
mert
mertOP2y ago
no need, its just like 3 commands and they have data propery cause /help command worked earlier sry im bad at debugging
treble/luna
treble/luna2y ago
according to your error one or more files dont have it
mert
mertOP2y ago
mert
mertOP2y ago
you meant like that?
treble/luna
treble/luna2y ago
yep, but also add which file
mert
mertOP2y ago
i did , __filename but it says that its commandhandler.js doesnt have it
treble/luna
treble/luna2y ago
well then that file does not have ot
mert
mertOP2y ago
why would it need it xd this is super weird
treble/luna
treble/luna2y ago
why do you read from it
mert
mertOP2y ago
for this
mert
mertOP2y ago
the events code works
treble/luna
treble/luna2y ago
yes but why is your command handlzr in the same directory as your commands
mert
mertOP2y ago
its not
mert
mertOP2y ago
mert
mertOP2y ago
or wdym
mert
mertOP2y ago
whats wrong with this whole code
mert
mertOP2y ago
wth???! whatever ima rewrite it thanks will anyone help me
mert
mertOP2y ago
Want results from more Discord servers?
Add your server