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

Error: Adapter registry error using typescript #452

Closed
leandrodaf opened this issue Apr 26, 2022 · 8 comments
Closed

Error: Adapter registry error using typescript #452

leandrodaf opened this issue Apr 26, 2022 · 8 comments
Milestone

Comments

@leandrodaf
Copy link

Problem registering adapter in socketIo using typescript.

image

Packages

{
    "devDependencies": {
       "typescript": "4.5.2"
    },
    "dependencies": {
       "@socket.io/redis-adapter": "^7.1.0",
       "socket.io": "^4.4.1"
    }
 }

I solved the problem by doing

image

But it doesn't seem like the best way to me.

@aggarwaldev
Copy link

Pinning the socket.io version to 4.4.1 seems to fix this.

Add the following to your package.json:

"socket.io": "4.4.1",

@muratkemaldar
Copy link

Had this issue also the other day and just wanted to created an issue for this as well :) Was also using the same workaround with as any.

@jonathan-nielsen
Copy link

I'm getting the exact same issues by simple running npm i -s socket.io @socket.io/redis-adapter redis as the installation step in the documentation at https://socket.io/docs/v4/redis-adapter/ says. This gives me the following in my package.json.

"@socket.io/redis-adapter": "^7.1.0"
"socket.io": "^4.5.0"
"redis": "^4.0.6"

@filoscoder
Copy link

Same issue here, as any solve it for now... expecting type upgrades soon 🥲

@darrachequesne
Copy link
Member

I'm looking into it, it seems to be linked to the features included in [email protected].

@schw4rzlicht
Copy link

schw4rzlicht commented May 2, 2022

I think I have narrowed down the issue to this commit and the typing changes that came with it: socketio/socket.io@891b187

darrachequesne added a commit that referenced this issue May 3, 2022
This feature was added in `[email protected]`:

```js
io.timeout(1000).emit("some-event", (err, responses) => {
  // ...
});
```

Thanks to this change, it will now work with multiple Socket.IO
servers.

Related:

- socketio/socket.io@8b20457
- #445
- #452
@darrachequesne
Copy link
Member

This should be fixed by e4c40cc, included in version 7.2.0. Thanks for the heads-up!

@darrachequesne darrachequesne added this to the 7.2.0 milestone May 4, 2022
@muratkemaldar
Copy link

Can confirm, error is gone.

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

7 participants