#Deploying via index.js errors but works.

11 messages · Page 1 of 1 (latest)

molten axle
#

Since I put my bot on an unmanaged host, it auto-starts with index.js and i'm not able to run deploy-commands myself, I decided to make the whole file a function and call it in of index,js . However, when doing so, it starts deploying, errors, but because of the catch{} it then finishes deploying and turns on. I was wondering how I could fix the error entirely. I attached the error and the relevant index.js code.

rigid plazaBOT
#

• 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.

molten axle
#

discord.js: 14.11.0
node: 20.2.0

alpine nexus
#

Since I put my bot on an unmanaged host, it auto-starts with index.js and i'm not able to run deploy-commands myself
you could run it yourself on your computer rather than on your host
but to address your actual error, it's likely you didn't actually export a function from deploy-commands and are just expecting it to be "call this function to run this file"

molten axle
#

better image with the lines

#

the entire file is a function

alpine nexus
#

but again, you could just side step the whole issue by running yourself on your computer rather than your host

molten axle
#

you mean just running deploy myself locally whenever necessary, while still having the bot on the host?

alpine nexus
#

yes

molten axle
#

ah ok, i wasnt sure i could do that.