-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Koa error #822
Comments
Hi @dan335 |
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'); |
This is weird, can you debug it, maybe it is related to the fact that you are using windows. |
Any update? |
Going to do a bit of necromancy here, but at work we use the Koa library to write our web server and I've been wanting to use the I made an attempt to use the library on a clean project and it works right off the bat, so my question is, would there be some kind of issue if I bound a bunch of routers and middlewares and then bound that bullboard plugin at |
For sure you can add any middleware before the mount of bull-board (check the auth with koa example) You should debug the adapter (probably something is interfering with the setup) |
Interesting, already started toying around but what do you mean by debugging the adapter. With the actual debugger or you mean there are some kind of debug logs that get dumped somewhere? |
No logs, you can modify the code (print to console paths) |
This seems reasonable no? I replaced some parts of the path but the actual path printed to my terminal is right, it leads me to the right place with the static files. KoaAdapter {
basePath: '/ui',
uiConfig: {
boardTitle: 'Bull Dashboard',
favIcon: {
default: 'static/images/logo.svg',
alternative: 'static/favicon-32x32.png'
}
},
viewPath: '<path-to-project>/<root-dir>/node_modules/@bull-board/ui/dist',
statics: {
route: '/static',
path: '<path-to-project>/<root-dir>/node_modules/@bull-board/ui/dist/static'
},
entryRoute: {
method: 'get',
route: [ '/', '/queue/:queueName', '/queue/:queueName/:jobId' ],
}
} I'd expect const BASE_PATH = '/ui' as const;
const PATH_TO_UI_ASSETS = path.dirname(require.resolve('@bull-board/ui/package.json'));
export function mountBullMQDashboard(app: Koa, queues: Queue[]) {
const serverAdapter = new KoaAdapter();
createBullBoard({
queues: queues.map((q) => new BullMQAdapter(q)),
serverAdapter,
options: { uiConfig: {}, uiBasePath: PATH_TO_UI_ASSETS },
});
serverAdapter.setBasePath(BASE_PATH);
app.use(serverAdapter.registerPlugin());
} |
Did you set the basePath of the adapter (what is the value of the base tag in the returned HTML?) |
Modified my previous comment with some more details. And the returned HTML resource is labeled |
What is the path of the 404 request of static flies that fails? |
For example: Same with all the other css (non-google) and js resources. |
Ur client side paths looks OK |
Same behaviour, unfortunately. |
Side question, can we |
I'll be able debug it with you tomorrow, ping me here? |
Alright. |
I'm available in Discord, my nick is |
Very helpful, added. |
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.
The text was updated successfully, but these errors were encountered: