Using bull-arena: "^3.2.2" version. Facing this error on starting arena dashboard
TypeError: as of 3.0.0, bull-arena requires that the queue constructors be provided to Arena
I tried to use the queue instance as a parameter instead of the queue name but no success.
source code:
import Arena from "bull-arena";
import Bull from "bull";
const queuesConfig = [];
for (const queue in queues) {
queuesConfig.push({
name: queues[queue],
hostId: "worker",
redis: { url: redisHost }
});
}
const arenaConfig = Arena({
queues: queuesConfig
}, {
basePath: "/",
disableListen: true,
});
Thanking you in advance for your help.
2
Answers
I have fixed this
type-error
. PR - #48242They have added required constructor condition in
bull-arena
but didn't update@types/bull-arena
. So, we were facing this issue.Either we have to provide Bull or Bee constructor to run the code. Now, it will work with
import
as well.Bull
Bee
If you don't provide any queue constructor, then it will throw this error.
I met this problem today.
The solution is as the documentation tells you that you need to specify the library you are supporting.
It could be clearer in my eyes, but somehow it makes sense. You need to import
bull
as Bull and add it to the config.so add
to the top of the file.
And add the imported
Bull,
to the Arena config.Something like this, and it should work. I implemented it in my code and it worked nicely.