socketio / socket.io-adapter

The Socket.IO in-memory adapter
https://socket.io/
197 stars 101 forks source link

socket.io-adapter block emit calls #71

Closed Hovhanns97 closed 3 years ago

Hovhanns97 commented 3 years ago

In my application, I have used a socket.io and also an adapter for it. Now when I try to send a response from the server to the frontend with socket.to(id).emit("message", message), it throws this error

unknown

It starts working again after I comment on the code that configures the adapter.

io.adapter(require("socket.io-redis")({host: "localhost", port: 6379}))

But it's not a good solution, because I need to use the adapter for my application. How can I fix this problem in another way?

darrachequesne commented 3 years ago

It sounds like a compatibility issue. Which version of socket.io-redis / socket.io are you using?

Related: https://github.com/socketio/socket.io-redis-adapter/issues/402

Hovhanns97 commented 3 years ago

I am using these versions. "socket.io": "4.0.1", "socket.io-client": "^4.1.2", "socket.io-redis": "^6.1.0",

darrachequesne commented 3 years ago

This should be fixed with socket.io-redis@6.1.1, could you please try to run npm update?

darrachequesne commented 3 years ago

Closed due to inactivity, please reopen if needed.