37 Replies
- 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.
- Issue solved? Press the button!node:events:491
throw er; // Unhandled 'error' event
^
TypeError: eventFunction is not a function
at Client.<anonymous> (C:\Users\matti\OneDrive\Desktop\spyro\src\handlers\eventHandler.js:16:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:394:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
Node.js v18.16.1
this is the error
and how did you define eventFunction
wait im gonna send u
one moment
i didnt
i dont know how to use this
how to use what
i defined it on const eventFunction but i dont know if it means defining
im new to this language
and does the file you import export anything
this one or other files in my code space
?
the one you try to import
your 'eventFile'
it's not a file it'a const
referred to other files
sigh
require is importing a file
so your eventFunction is whatever your file exports
lets do a thing
i send u all the file in exam
so u can see
just send the file you are trying to import
since you're new i assume you dont have many files
can u tell me what's wrong in this?
ok thats not what im asking.
do any of the files in your eventFolder export anything
yes
just the client and an argument (interaction)
console.log your eventfucntion, without (), before calling it
ok im trying now
the same error
@luna🌈
yeah
show the output of that console.log
.
no
no wait
thats not the output
yeah sorry
.
this one
thats the error
i asked what the console.log returned
he returned that i just did it and it showed me the error again
and whats above your error
nothing
my command
show the log
Spyro#9186 è online
this is the only thing above the error
just send a screenshot
idk what to say
how many files are in your eventfolder
2 folders: 1) 1 file 2) 2 files
can you console.log the eventfile