TypeError: this.dispatch is not a function
Hi Guys I use @discordjs/rest but when I try to do a request I always get:
My Code:
NPM Version:
@discordjs/[email protected]
NodeJS: v18.12.0
26 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
v18
you can see the node version already Qjuh
interesting, thats quite an old undici version
can you nuke your lockfile and node_modules folder and reinstall deps?
and then ls again
sure
Updated it now and deleted what u requested before reinstalling
Error still happen :(
I've recently made a bot with djs rest and it worked fine
that said I AM on 18.14.0
Same, but now I have this and idk why xD
I could try updating my nodejs on my server in hope that it dont break my other bots
it definitely shouldn't break
..can you get a fresh stack trace
because that stack doesn't match with undici code
The agent breaking tho
no
thats the trace now
Can you share your rest instance options?
1. sec im eating something now
...
YEAH ok so
thats not
what you use setAgent for
you're looking for userAgentAppendix option in the constructor
sooo remove the setAgent line and it'll all work
does setAgent not set "User-Agent" ?
nop, and types should've told you that
only says that https://sean.does-co.de/YU3AK8Xa
i though its the useragent lol
i mean
agent: you used TS it would've yelled at you)
Yeah but I dont use ts x D
fair nuff
I'm to lazy for this typing stuff xD
I try it now
Also we don't allow overwriting the user-agent fully, but we do let you append extra data to it
Also fine
Okay it works now thank you for your help !
no worries