Ask coding questions

← Back to all posts
project not loading because of promise pending
JasonCark

for some reason when i try booting my discord bot it says "Promise { pending } when i dont have a promise or anything..

heres my index.js:

Voters
RusstyCrussty
JasonCark
Comments
hotnewtop
Coder100

It returns a promise, it will take time to fulfill the promise.
client.login is a promise if you forgot ;)

JBloves27

oh, i don't know node.js xD @Coder100

Coder100

xD no worries @JBYT27

JasonCark

@Coder100 do i add ".then" and ".catch"? because on other hosting websites that doesnt return a promise

(it also isnt documented in the discordjs docs)

Coder100

nope, this is repl.it they for some reason print out the return value of the last statement, if you add console.log("hi") you see the promise is gone @JasonCark

JBloves27

Like one other people have person said, This happens sometimes, idk why, but yeah. So try reloading, it might help. :)

JasonCark

@JBYT27 doesnt work i tried it multiple times.

JBloves27

oh. hmmm, maybe there's an error with the code? @JasonCark

RYANTADIPARTHI

You might want to refresh. It happens. Just refresh and run it again.

Coder100

doesn't help if that's what the code does silly @RYANTADIPARTHI