-
Notifications
You must be signed in to change notification settings - Fork 487
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
Broadcast: Cannot read properties of undefined (reading 'Sender') on ws_1.WebSocket.Sender #478
Comments
I'm digging into this. |
The named import is not supported in some cases: > node_modules/socket.io-adapter/dist/index.js:170 > packetOpts.wsPreEncodedFrame = ws_1.WebSocket.Sender.frame(data, { > ^ > > TypeError: Cannot read properties of undefined (reading 'Sender') > at RedisAdapter._encode (/.../node_modules/socket.io-adapter/dist/index.js:170:59) > at RedisAdapter.broadcast (/.../node_modules/socket.io-adapter/dist/index.js:117:37) Related: socketio/socket.io-redis-adapter#478
This should be fixed by socketio/socket.io-adapter@99b0f18, included in |
Thanks for the quick answer !! It seems there is an error:
|
Hmm, that's weird,
|
which version of Node.js are you using? which OS? did you try to remove the node_modules directory and reinstall all modules? I have listed on my project dependencies |
Hi ! We found the bug: we use the command So to fix this, i added the Thanks for your work by the way! |
Hi, I struggle with the same issue. Is the way described in #478 (comment) the recommended way to resolve the issue? cc @darrachequesne |
Unfortunately, I'm not able to reproduce the issue:
I guess we can list Related: #481 |
We use The manual installation of |
- `socket.io@latest` depends on `socket.io-adapter@~2.4.0`, which resolves to `[email protected]` - `@socket.io/redis-adapter@latest` depends on `socket.io-adapter@^2.4.0`, which resolves to `[email protected]` (released a few days ago) Typescript complains that the two types do not match: > Argument of type '(nsp: any) => RedisAdapter' is not assignable to parameter of type 'AdapterConstructor'. > Type '(nsp: any) => RedisAdapter' is not assignable to type '(nsp: Namespace<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>) => Adapter'. > Type 'RedisAdapter' is not assignable to type 'Adapter'. > Types have separate declarations of a private property 'encoder'. Related: - #478 - #482
In order to prevent issues like [1]. Note: the version matches the one imported by the `engine.io` package See: https://github.com/socketio/engine.io/blob/6.3.0/package.json#L43 [1]: socketio/socket.io-redis-adapter#478
Hi !
I used to broadcast socket and worked fine ! But a new error appeared on calling
client.broadcast.emit('hello');
Error:
If i remove the broadcast instruction like
client.emit('hello');
it works! But the current client received it too...Versions:
"@socket.io/redis-adapter": "^8.0.0", // same issue with v7
"socket.io": "^4.5.4",
"socket.io-client": "^4.5.4",
The text was updated successfully, but these errors were encountered: