Skip to content
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-redis v4.0.0 #427

Closed
christiancuri opened this issue Nov 11, 2021 · 1 comment
Closed

node-redis v4.0.0 #427

christiancuri opened this issue Nov 11, 2021 · 1 comment

Comments

@christiancuri
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @socket.io/[email protected] for the project I'm working on.

My problem

error: uncaughtException: this.subClient.psubscribe is not a function
TypeError: this.subClient.psubscribe is not a function

Solution

node-redis v4 changed the function names. it's all uppercase now.

Here is the diff that solved my problem:

diff --git a/node_modules/@socket.io/redis-adapter/dist/index.js b/node_modules/@socket.io/redis-adapter/dist/index.js
index 47a62f2..7f22a6f 100644
--- a/node_modules/@socket.io/redis-adapter/dist/index.js
+++ b/node_modules/@socket.io/redis-adapter/dist/index.js
@@ -61,9 +61,9 @@ class RedisAdapter extends socket_io_adapter_1.Adapter {
                 this.emit("error", err);
             }
         };
-        this.subClient.psubscribe(this.channel + "*", onError);
+        this.subClient.PSUBSCRIBE(this.channel + "*", onError);
         this.subClient.on("pmessageBuffer", this.onmessage.bind(this));
-        this.subClient.subscribe([this.requestChannel, this.responseChannel], onError);
+        this.subClient.SUBSCRIBE([this.requestChannel, this.responseChannel], onError);
         this.subClient.on("messageBuffer", this.onrequest.bind(this));
         this.pubClient.on("error", onError);
         this.subClient.on("error", onError);

This issue body was partially generated by patch-package.

@christiancuri christiancuri changed the title Node-redis v4 node-redis v4.0.0 Nov 11, 2021
@darrachequesne
Copy link
Member

See also: #423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants