You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've searched for any related issues and avoided creating a duplicate issue.
Description
I am using ws as a WebSocket client in a Next.js application in production mode inside of a docker container, and I got this error before installing bufferutil:
web-1 | TypeError: t.mask is not a function
web-1 | at e.exports.mask (.next/server/chunks/4059.js:2:17385)
web-1 | at y.frame (.next/server/chunks/4059.js:2:25319)
web-1 | at y.dispatch (.next/server/chunks/4059.js:2:28129)
web-1 | at y.send (.next/server/chunks/4059.js:2:27662)
web-1 | at I.send (.next/server/chunks/4059.js:2:9247)
web-1 | at I.i (.next/server/chunks/9184.js:58:4416)
This bug doesn't happen when running Next.js in development mode.
$ npm ls
gh-2288@ /Users/luigi/Desktop/gh-2288
`-- [email protected]
$ cat index.mjs
import WebSocket from 'ws';
const ws = new WebSocket('wss://websocket-echo.com/');
ws.on('error', console.error);
ws.on('open', function open() {
console.log('connected');
ws.send(Date.now());
});
ws.on('close', function close() {
console.log('disconnected');
});
ws.on('message', function message(data) {
console.log(`Round-trip time: ${Date.now() - data} ms`);
setTimeout(function timeout() {
ws.send(Date.now());
}, 500);
});
$ node index.mjs
connected
Round-trip time: 124 ms
Round-trip time: 129 ms
Round-trip time: 130 ms
Round-trip time: 130 ms
Round-trip time: 128 ms
Round-trip time: 129 ms
Round-trip time: 129 ms
^C
Is there an existing issue for this?
Description
I am using
ws
as a WebSocket client in a Next.js application in production mode inside of a docker container, and I got this error before installingbufferutil
:This bug doesn't happen when running Next.js in development mode.
ws version
^8.18.2
Node.js Version
v23.11.1
System
Expected result
ws.send()
to not throwActual result
ws.send()
throwsTypeError: t.mask is not a function
Attachments
No response
The text was updated successfully, but these errors were encountered: