Property 'id' does not exist on type 'APIGuild'.
via Discord-Api-Types package, latest, I am receiving the type error:
Type error: Property 'id' does not exist on type 'APIGuild'.
But according to documentation, this should not be the case. I have no idea how to fix this, I have tried; restarting typescript server, restarting PC, reinstalling packages, and a myriad of other common fixes.
What on earth is happening?7 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!
My vercel output where the error occurs:
The relevant code:
probably because
guildRes.guild
possibly null..The jsx where guild.id is used is wrapped in a guild not null condition.
show the getGuild function
I’m on mobile, but The get guild function fetch request discord api for v10 guild, inline with what discord api types APIGuild should be
Or, null, since it might not exist
Is there no solution lol?
Can you setup a minimum repro sample please? 🙏
Also try bumping -types too and let us know if it still happens