bull-board: Wrong types in bull-board

When I try to compile the following code, this error occurs

const adapters = [new BullAdapter(this.chatroomQueue)];
setQueues(adapters);

Error

Argument of type 'BullAdapter[]' is not assignable to parameter of type 'readonly QueueAdapter[]'.
  Type 'BullAdapter' is not assignable to type 'QueueAdapter'.
    The types returned by 'getClient()' are incompatible between these types.

It is caused by BullAdapter.getClient() returns Promise<Queue['client']> while Queue extends EventEmitter and setQueues only accept QueueAdapter[] and QueueAdapter.getClient returns Promise<Redis.Redis> (Redis.Redis is a type of ioredis)

Please fix the types definition if available, thanks.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (11 by maintainers)

Most upvoted comments

I’ve downgraded the bull version to 3.15.0, and I get the same install result.

├─┬ bull-board@1.5.3
│ ├─┬ @types/bull@3.15.0
│ │ └── @types/ioredis@4.22.3 deduped
│ └── @types/ioredis@4.22.3
└─┬ bullmq@1.20.0
  └── @types/ioredis@4.22.3 deduped

Pls remove any lock files and reinstall you deps.

The issue is gone now and can be compiled now, thank you very much