felixmosh / bull-board

🎯 Queue background jobs inspector
MIT License
2.32k stars 364 forks source link

Koa error #822

Open dan335 opened 1 month ago

dan335 commented 1 month ago

I get this error when using with Koa.

Error: ENOENT: no such file or directory, open 'D:\web\ai_ledger\views\index.ejs.html'

I'm guessing it's because I'm using @koa/router instead of koa-router which is not supported anymore.

felixmosh commented 1 month ago

Hi @dan335 It looks like it is not related to the router version. For some reason, this line is not working. Check the reason for that (maybe you are using bundler for the node part?) Anyway, you can provide options.uiBasePath by yourself, it shoud get the path to the node_modaules/@bull-board/ui folder.

dan335 commented 1 month ago

Still can't get this to work. See anything wrong? The output of console.log(uiBasePath) is the correct path.

const serverAdapter = new KoaAdapter();

serverAdapter.setBasePath('/admin/queues');

const uiBasePath = join(__dirname, '../', 'node_modules', '@bull-board', 'ui');

console.log(uiBasePath)

createBullBoard({
  queues: [
    new BullMQAdapter(queueUpdateTransactionCategory),
    new BullMQAdapter(queueTrainModel),
    new BullMQAdapter(queueSyncTransactions),
  ],
  serverAdapter,
  options: { uiBasePath }
});

await app.use(serverAdapter.registerPlugin());

Also tried

const uiBasePath = join(__dirname, '../', 'node_modules', '@bull-board', 'ui', 'package.json');
felixmosh commented 1 month ago

This is weird, can you debug it, maybe it is related to the fact that you are using windows.

felixmosh commented 3 weeks ago

Any update?