-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node.js and Socket.io UTF8 Validation TypeError coming from ws #1021
Comments
So, it appears you've closed, reopened, then closed this issue. I'm assuming you've solved this problem, then? Wanna enlighten us folks who are still having this problem? |
I figured out a fix that doesn't require deleting the if statement. I'm pretty sure there's something wrong with the version of |
@vonzimr |
Getting this error when validating data received from the client through socket.io.
C:\Users\Rayce\Documents\SENG513\node-js-getting-started\node_modules\socket.io\node_modules\ws\lib\Receiver.js:532 6:23:55 PM web.1 | if (!Validation.isValidUTF8(messageBuffer)) { 6:23:55 PM web.1 | ^ 6:23:55 PM web.1 | TypeError: Cannot read property 'isValidUTF8' of undefined 6:23:55 PM web.1 | at C:\Users\Rayce\Documents\SENG513\node-js-getting-started\node_modules\socket.io\node_modules\ws\lib\Receiver.js:532:28 6:23:55 PM web.1 | at C:\Users\Rayce\Documents\SENG513\node-js-getting-started\node_modules\socket.io\node_modules\ws\lib\Receiver.js:368:7 6:23:55 PM web.1 | at C:\Users\Rayce\Documents\SENG513\node-js-getting-started\node_modules\socket.io\node_modules\ws\lib\PerMessageDeflate.js:249:5 6:23:55 PM web.1 | at afterWrite (_stream_writable.js:355:3) 6:23:55 PM web.1 | at onwrite (_stream_writable.js:346:7) 6:23:55 PM web.1 | at WritableState.onwrite (_stream_writable.js:89:5) 6:23:55 PM web.1 | at afterTransform (_stream_transform.js:79:3) 6:23:55 PM web.1 | at TransformState.afterTransform (_stream_transform.js:54:12) 6:23:55 PM web.1 | at Zlib.callback (zlib.js:613:5) [DONE] Killing all processes with signal null 6:23:55 PM web.1 Exited with exit code 1
Editing out this section of code in Receiver.js,
if (!Validation.isValidUTF8(messageBuffer)) { self.error('invalid utf8 sequence', 1007); return; }
stops the error from occuring but I would prefer a better solution as I'd like to use NPM and can't be bothered to redo this every time an update occurs.
I have also tried installing utf-8-validate into the node_modules folder of socket.io
The text was updated successfully, but these errors were encountered: