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 passing in ioredis v5 instance to connection #1167

Closed
JClackett opened this issue Mar 30, 2022 · 4 comments
Closed

Error passing in ioredis v5 instance to connection #1167

JClackett opened this issue Mar 30, 2022 · 4 comments

Comments

@JClackett
Copy link

The new ioredis package bundles its own TS types now and when passing in the redis instance to the connection of the Queue I get:

Type 'Redis' is not assignable to type 'ConnectionOptions | undefined'.
  Type 'Redis' is missing the following properties from type 'Cluster': nodes, rpushBuffer, lpushBuffer, hsetBuffer, and 2 more.ts(2322)

Investigating I see that the connection property is expecting a Redis type based off the @types/ioredis package, and it doesn't seem to match the with the new one.

bullmq v1.78.1
ioredis v5.0.2

Reverting to old ioredis fixed ts issue

@JClackett JClackett changed the title Error passing in Redis instance to connection Error passing in ioredis v5 instance to connection Mar 30, 2022
@manast
Copy link
Contributor

manast commented Mar 31, 2022

Can you provide a complete code snippet that reproduces the error?

@JClackett
Copy link
Author

There must have been some issue with may node_modules as a fresh install stopped the errors!

@soulchild
Copy link

This seems to become an issue when you have dependencies installed which bring in @types/ioredis- in my case @types/connect-redis. This makes the TypeScript compiler pick up those types which probably clash with the now built-in types of ioredis >= 5.

@manast
Copy link
Contributor

manast commented May 4, 2022

makes sense. ioredis 5 is quite new though, it may be safer to keep using the v4 until v5 gets more mature.

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

3 participants