TypeError: Cannot read properties of undefined (reading 'cache')

This error is very rare, it only happened once, today
const member = await ButtonInteraction<"cached">#guild.members.fetch(memberId);
member.roles.cache
const member = await ButtonInteraction<"cached">#guild.members.fetch(memberId);
member.roles.cache
3 Replies
d.js toolkit
d.js toolkit3w ago
- 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!
Mark
Mark3w ago
Log member, I wager it's a collection. Would happen if memberId is undefined
Gorniaky
GorniakyOP3w ago
you're right, maybe the memberId is undefined...

Did you find this page helpful?