Closed NeuroWhAI closed 2 months ago
Hi. Do you have a full stack trace? I'd like to see what invoked onError
I will reproduce and get the trace log.
Here is a trace log. @didinele
error: Uncaught TypeError: Cannot use 'in' operator to search for 'code' in undefined
at WebSocketShard.onError (file:///C:/Users/neurobox/AppData/Local/deno/npm/registry.npmjs.org/@discordjs/ws/1.1.1/dist/index.js:1065:16)
at WebSocket.connection.onerror (file:///C:/Users/neurobox/AppData/Local/deno/npm/registry.npmjs.org/@discordjs/ws/1.1.1/dist/index.js:683:12)
at WebSocket.wrappedHandler (ext:deno_web/02_event.js:1401:12)
at innerInvokeEventListeners (ext:deno_web/02_event.js:754:7)
at invokeEventListeners (ext:deno_web/02_event.js:801:5)
at dispatch (ext:deno_web/02_event.js:658:9)
at WebSocket.dispatchEvent (ext:deno_web/02_event.js:1043:12)
at WebSocket.[[[eventLoop]]] (ext:deno_websocket/01_websocket.js:471:16)
at eventLoopTick (ext:core/01_core.js:168:7)
If possible, would you be able to log event
here so we can see what the payload is?
@Jiralite It was {}
... 🤔
connection.onerror = (event) => {
console.log("=======================================");
console.log(JSON.stringify(event));
console.log("=======================================");
this.onError(event.error);
};
=======================================
{}
=======================================
That's most certainly a deno bug of some sort then, recommend reporting it.
Which package is this bug report for?
ws
Issue description
Error :
TypeError: Cannot use 'in' operator to search for 'code' in undefined
Location: https://github.com/discordjs/discord.js/blob/main/packages/ws/src/ws/WebSocketShard.ts#L794If I manually modify the conditional statement locally as follows, the problem no longer occurs. But I'm not sure if it's okay to do this.
I'm not sure if this is due to differences between Deno and Node.js, but I suspect it is.
Code sample
No response
Versions
Issue priority
Low (slightly annoying)
Which partials do you have configured?
No Partials
Which gateway intents are you subscribing to?
Guilds, GuildMessages, MessageContent
I have tested this issue on a development release
No response