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

Type 'Redis' is not assignable to type 'ConnectionOptions' #1391

Closed
antirek opened this issue Aug 24, 2022 · 2 comments
Closed

Type 'Redis' is not assignable to type 'ConnectionOptions' #1391

antirek opened this issue Aug 24, 2022 · 2 comments

Comments

@antirek
Copy link

antirek commented Aug 24, 2022

up bullmq deps to 1.89.2, don't compile, error below

in code I create redisConn and pass it to Worker

const redisConn = new Redis(config.WORKER_REDISURL);  // from ioredis
const worker = new Worker(`${config.WORKER_QUEUE}`, async job => {
    return await doWork(job);
  }, {
    connection: redisConn,    
  });

error:

worker/app.ts:133:5 - error TS2322: Type 'Redis' is not assignable to type 'ConnectionOptions'.
  Type 'Redis' is missing the following properties from type 'Redis': stream, isCluster, connector, reconnectTimeout, and 140 more.

133     connection: redisConn,
        ~~~~~~~~~~

  node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:14:5
    14     connection?: ConnectionOptions;
           ~~~~~~~~~~
    The expected type comes from property 'connection' which is declared here on type 'WorkerOptions'

worker/app.ts:141:5 - error TS2322: Type 'Redis' is not assignable to type 'ConnectionOptions'.

141     connection: redisConn.duplicate(),
        ~~~~~~~~~~

  node_modules/bullmq/dist/esm/interfaces/queue-options.d.ts:14:5
    14     connection?: ConnectionOptions;
           ~~~~~~~~~~
    The expected type comes from property 'connection' which is declared here on type 'QueueSchedulerOptions'


Found 2 errors in the same file, starting at: worker/app.ts:133
@antirek
Copy link
Author

antirek commented Aug 24, 2022

sorry, up ioredis to actual 5 version

@antirek antirek closed this as completed Aug 24, 2022
@ed-asriyan
Copy link

ed-asriyan commented Dec 27, 2022

the issue resolved for me after upgrade ioredis to 5.2.4 (it did not work on 5.2.1)

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