Invalid WebSocket frame: invalid UTF-8 sequence

Received this unhandled rejection today. I think it bad data from Discord, but I wasn't able to track what the data actually looked like. FWIW I also have zlib-sync enabled
Error: Invalid WebSocket frame: invalid UTF-8 sequence
at Receiver.dataMessage (/home/jam/discordbot/node_modules/ws/lib/receiver.js:583:28)
at Receiver.getData (/home/jam/discordbot/node_modules/ws/lib/receiver.js:496:10)
at Receiver.startLoop (/home/jam/discordbot/node_modules/ws/lib/receiver.js:167:16)
at Receiver._write (/home/jam/discordbot/node_modules/ws/lib/receiver.js:94:10)
at writeOrBuffer (node:internal/streams/writable:570:12)
at _write (node:internal/streams/writable:499:10)
at Writable.write (node:internal/streams/writable:508:10)
at Socket.socketOnData (/home/jam/discordbot/node_modules/ws/lib/websocket.js:1355:35)
at Socket.emit (node:events:520:28)
at addChunk (node:internal/streams/readable:559:12)
Error: Invalid WebSocket frame: invalid UTF-8 sequence
at Receiver.dataMessage (/home/jam/discordbot/node_modules/ws/lib/receiver.js:583:28)
at Receiver.getData (/home/jam/discordbot/node_modules/ws/lib/receiver.js:496:10)
at Receiver.startLoop (/home/jam/discordbot/node_modules/ws/lib/receiver.js:167:16)
at Receiver._write (/home/jam/discordbot/node_modules/ws/lib/receiver.js:94:10)
at writeOrBuffer (node:internal/streams/writable:570:12)
at _write (node:internal/streams/writable:499:10)
at Writable.write (node:internal/streams/writable:508:10)
at Socket.socketOnData (/home/jam/discordbot/node_modules/ws/lib/websocket.js:1355:35)
at Socket.emit (node:events:520:28)
at addChunk (node:internal/streams/readable:559:12)
Versions: node: v22.7 discord.js: 14.16.0-dev.1724544741-437437461 @discordjs/ws: 1.1.1
4 Replies
d.js toolkit
d.js toolkit4mo 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!
Jake
JakeOP4mo ago
Possibly related to latest nodejs release https://github.com/nodejs/node/issues/54543 although this is the first time it's happened to me
GitHub
UTF+8 encodings are broken · Issue #54543 · nodejs/node
Version 22.7.0 Platform Linux api-deployment-694785c9f5-8dd8j 5.10.223-211.872.amzn2.x86_64 #1 SMP Mon Jul 29 19:52:29 UTC 2024 x86_64 GNU/Linux Subsystem No response What steps will reproduce the ...
Almeida
Almeida4mo ago
Yep I've also gotten DiscordAPIError[50109]: The request body contains invalid JSON., probably the same issue
Almeida
Almeida4mo ago
GitHub
Buffer.from() output breaks after optimizing in nodejs 22.7 · Issue...
Version v22.7.0 Platform Darwin moe.fritz.box 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:13:18 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6030 arm64 Subsystem Buffer What steps will rep...
Want results from more Discord servers?
Add your server