Closed xcjs closed 3 months ago
Stacktrace here:
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'reduce')
at BaseInteraction (node_modules\discord.js\src\structures\BaseInteraction.js:106:43)
at MessageComponentInteraction (node_modules\discord.js\src\structures\MessageComponentInteraction.js:17:5)
at ButtonInteraction (node_modules\discord.js\src\structures\ButtonInteraction.js:9:1)
at handle (node_modules\discord.js\src\client\actions\InteractionCreate.js:90:25)
at module.exports (node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at handlePacket (node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at <anonymous> (node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
at emit (node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:282:31)
at <anonymous> (node_modules\@discordjs\ws\dist\index.js:1190:51)
at emit (node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:282:31)
at onMessage (node_modules\@discordjs\ws\dist\index.js:1005:14)
at processTicksAndRejections (internal/process/task_queues:95:5)
This appeared to work fine over the last week.
Got same issue in all my bots suddenly
Yeah - seemingly for any interaction type too, not just for buttons. I suspect this is a Discord API issue or change?
TypeError: Cannot read properties of undefined (reading 'reduce')
application-1 | at new BaseInteraction (node_modules/discord.js/src/structures/BaseInteraction.js:106:43)
application-1 | at new CommandInteraction (node_modules/discord.js/src/structures/CommandInteraction.js:16:5)
application-1 | at new ChatInputCommandInteraction (node_modules/discord.js/src/structures/ChatInputCommandInteraction.js:13:5)
application-1 | at InteractionCreateAction.handle (node_modules/discord.js/src/client/actions/InteractionCreate.js:90:25)
application-1 | at module.exports [as INTERACTION_CREATE] (node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
application-1 | at WebSocketManager.handlePacket (node_modules/discord.js/src/client/websocket/WebSocketManager.js:355:31)
application-1 | at WebSocketManager.<anonymous> (node_modules/discord.js/src/client/websocket/WebSocketManager.js:239:12)
application-1 | at WebSocketManager.emit (node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
application-1 | at WebSocketShard.<anonymous> (node_modules/@discordjs/ws/dist/index.js:1190:51)
application-1 | at WebSocketShard.emit (node_modules/@vladfrangu/async_event_emitter/dist/index.cjs:282:31)
My bot that was running fine for 21 days has shown this also, it seems to be in all types of interactions
@J4Wx I'm suspecting this is some kind of infrastructure issue. I noticed a few other large service web sites acting odd recently, which makes me assume some cloud provider is having issues.
Yeah - this bot has been running (unmodified) for months without issue. I don't believe that this is a Discord JS issue.
This is a known issue due to unexpected API behavior changes. The current workaround for now is to downgrade to discord.js v14.14.1.
same issue
@TAEMBO I'm seeing a completely different issue now - unknown interactions. My interactions are keyed to an enum, so that shouldn't be a problem.
downgrading, (in my case, upgrading), fixed the issue for me in my bot, the funny thing is that both my bots were in ˆ14.9.0 version of discord.js and only one of them was affected, the bigger one
@falcao-g What version did you upgrade to?
14.14.1
So, to fix it, change this.entitlements = data.entitlements.reduce
to this.entitlements = data.entitlements?.reduce
14.15.3
same issue just happened today after stable for a long time and did not touch anything.
Same thing happened to me just downgraded to 14.15.1 for now (works for me)
14.15.3
Downgraded to 14.14.1 and issue fixed. No idea what caused it
this is an issue caused by Discord, from what i have seem, they are already aware of it, for us, we have two options, either changing the line of code to something like this: this.entitlements = (data.entitlements ?? []).reduce
or changing the discord.js version to 14.14.1
That makes sense. Easiest solution is downgrading to 14.14.1
Same problem for latest version as well v14.15.3
This is a known issue due to unexpected API behavior changes. The current solution for now is to downgrade to discord.js v14.14.1.
Thank you so much, I thought I was going absolutely crazy since my code has not changed at all and suddenly everything just broke. After banging my head against the wall for two hours and seeing your post, setting the version to 14.14.1
fixed it for me.
Downgrading to 14.14.1 did not solve this issue for me. Which version are you using for discord-api-types, @discordjs/builders, @discordjs/rest?
(Manually changing the code to this.entitlements = (data.entitlements ?? []).reduce
worked)
Same issue!
this is an issue caused by Discord, from what i have seem, they are already aware of it, for us, we have two options, either changing the line of code to something like this:
this.entitlements = (data.entitlements ?? []).reduce
or changing the discord.js version to 14.14.1
saved my life
downgrading to 14.14.1 worked for me 👍
A similar error occurred in 14.14.1. Perhaps it is not a continuous occurrence, but rather a rare case of data.entitlements being undefined.
any ideas on when it will be fixed?
I have the same issue on v14.15.3
This was a Discord issue that is now resolved.
Which package is this bug report for?
discord.js
Issue description
Code sample
Versions
Issue priority
Low (slightly annoying)
Which partials do you have configured?
Not applicable
Which gateway intents are you subscribing to?
MessageContent
I have tested this issue on a development release
No response