Program can't locate file.
viewCaptcha.jsThis code, Well.. It works fine but, It can't seem to actually find the file at the file path as it logs this error. I've also attached an image of the file path with the files existing. Could anyone lend me a hand figuring out why this isn't working
35 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 OPShow your whole folders structure
Let me grab a screenshot for you
It's passed as a full directory not a relative
navigate into the captchas folder and run
pwd
i have an idea, but that'll confirm itOn it!
it tries to read that, but it isn't there, but it is there
what
and this is running on that system? not in some container, etc?
also what is the full stacktrace of that error
Nope, straight in system
There is none, That is the error xD
yeah, nah, then you're doing nonsense
it's not very helpful
if you actually log the full error and do not stringify it you get more from it
OH WAIT welp.. look at me bein stoopid again let me go change tht
If you aren't getting any errors, try to place
console.log
checkpoints throughout your code to find out where execution stops.
- Once you do, log relevant values and if-conditions
- More sophisticated debugging methods are breakpoints and runtime inspections: learn morehm. no. bad tag
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.
- Note: if you initialize your Client as
bot
or other identifiers you need to use these instead of client
- If the output is too long to post consider using a bin instead: gist | paste.gg | sourceb.in | hastebincloser
still not it
XD
you'll get it eventually <3
ignore that, just
console.log(error)
or console.dir(error, {depth: null})
if you want ALL of itI changed it and the full stack is this
I hope that helps
that should still have more, like a reference to the part that tries to read the file in the first place should be node
ENOENT: no such file or directory
in here usually means someone is confusing readdir with require using relative imports, one reads from cwd one reads from the file itself
but you provide a full pathunless i am blind, these two are also the same
Those two are the same correct <a:kitty_spin:1044167622746439710>
I'm passing it the full path
do you have some weird character in one of the file names or sth? that's all i can think of
boop
das all
can you paste, not screenshot me the output of
ls -la
in that captchas foldershit that is a fair point..
do you want me to grab and send the code here?
Because that is genuinely a fair point
i'll take a look at it and try await it but, if i need help (I probably will so dont get your hopes up <3) i'll nudge ^^
oh it WRITES that one dynamically, yeaah, that aint a thing when that tries to read it then
i forgor to write it with await
XD
shit works :>
Thanks you two