-
-
Notifications
You must be signed in to change notification settings - Fork 363
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
Error: Dynamic require of "path" is not supported #570
Comments
How does ot related? From what I know, if your project uses esm, it can consume cjs, am I right? |
Yeah, that's what I thought @felixmosh , but I'm getting that error for some reason. Here's the stack trace:
|
What is the line that it complains on? |
This one @felixmosh If I don't add the .js I get this error |
Not sure what is the issue, but where is the usage of path? |
I don't use 'path' anywhere in my code @felixmosh . The errors shows when calling this function // Queues monitoring UI
const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath('/queues/monitor');
createBullBoard({
queues: [
new BullMQAdapter(netsuiteQueueSync),
new BullMQAdapter(netsuiteQueueCore),
],
serverAdapter,
}); |
Maybe it is related to this line, https://github.com/felixmosh/bull-board/blob/master/packages/api/src/index.ts#L18 Which makes several issues... I need to think how to solve it. Do you have any suggestion? related #444 |
hmm, I'll try to take a look. For a moment I thought the problem was my dev server, but the issue also show when running directly with node. It builds fine, it just comes up at runtime. I'm surprise nobody else has experienced this issue. |
Hey @felixmosh, can you explain what the purpose of that line there is? Which path are you trying to resolve and why? |
It is the path for static ui files. |
I see. You want to place those .css, .js, and assets at the same level as the UI package e.g node_modules/@bull-board/ui/dist/static? If so, can't you just hard code this location relative to the lib instead of doing so dynamically @felixmosh ? |
It was relative, and we had some bug related to it... :) I think that a better solution would be to allow users to provide that value for cases that default resolving is not working out of the box. |
Yeah, that's what I was getting to. In such cases it's better to have the users provide the patch explicitly. |
Can you try createBullBoard({
queues: [new BullMQAdapter(exampleBullMq)],
serverAdapter,
options: { uiBasePath: 'YOUR_PATH_TO_@bull-board/ui' } // <--------
}); |
Hey @felixmosh that seems to do trick. Thanks a lot! |
Hi, I'm getting the following error
Error: Dynamic require of "path" is not supported
whentype: module
in package.json. Does the library supportsesm
?The text was updated successfully, but these errors were encountered: