Skip to content
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

fails to build #546

Closed
japrescott opened this issue Mar 7, 2023 · 10 comments
Closed

fails to build #546

japrescott opened this issue Mar 7, 2023 · 10 comments

Comments

@japrescott
Copy link

japrescott commented Mar 7, 2023

Hey @felixmosh

Currently 4.12.2 is failing to build with bull-board with only "@bull-board/express": "~4.12.2" and "bullmq": "~3.10.1" as dependencies

node_modules/@bull-board/api/dist/src/queueAdapters/bull.d.ts(1,28): error TS2307: Cannot find module 'bull' or its corresponding type declarations.

We only import import { BullMQAdapter, ExpressAdapter, createBullBoard } from '@bull-board/express'; so bull should not be needed.

However, adding "bull": "~4.10.4" to the dependencies resolves this issue.

@felixmosh
Copy link
Owner

felixmosh commented Mar 7, 2023

Hi @japrescott thank you for reporting this issue.

Can you try to change the import to work with

import {ExpressAdapter} from '@bull-board/express';
import {createBullBoard} from '@bull-board/api';
import {BullMQAdapter} from '@bull-board/api/bullMQAdapter';

It is related to #500, maybe, @mmachatschek can help with this....

@mmachatschek
Copy link
Contributor

@japrescott I'm not sure why exactly you are seeing this issue, we are using this feature in production since the release of the feature 🤔

our dependencies are @bull-board/express and bullmq

  import { ExpressAdapter, createBullBoard, BullMQAdapter } from '@bull-board/express';

  const queues = pseudoCodeReturnSomeQueues();

  const serverAdapter = new ExpressAdapter();

  createBullBoard({
    queues: Object.values(queues).map(queue => new BullMQAdapter(queue())),
    serverAdapter: serverAdapter,
  });

Are you 100% sure you are not importing import { BullAdapter } from '@bull-board/express'; somewhere?

Would be great to have a repo with reproduction steps. I'll happily fix an issue (if one persists).

@felixmosh
Copy link
Owner

It is a typescript issue, that I'm able to reproduce.

@mmachatschek
Copy link
Contributor

mmachatschek commented Mar 7, 2023

@felixmosh I'm able to reproduce this too after setting the skipLibCheck: false in my tsconfig

@felixmosh
Copy link
Owner

This is the reason I've separated queueAdapters into separate files.

@mmachatschek
Copy link
Contributor

mmachatschek commented Mar 7, 2023

I've experimented around a little bit and I see these two options to still support this feature:

  1. telling users to use skipLibCheck: true in their tsconfig
  2. alternative solution:
    1. deprecate the exports of import { BullMQAdapter, BullMQAdapter } from '@bull-board/express';
    2. provide exports for both the bullmq adapter and bull:
import { ExpressAdapter, createBullBoard, BullAdapter } from '@bull-board/express/bull';
import { ExpressAdapter, createBullBoard, BullMQAdapter } from '@bull-board/express/bullMQ';

This would be a similar export like it's already done in @bull-board/api/bullAdapter and @bull-board/api/bullMQAdapter

I'm sending in a PR tomorrow, to see all the implications

@felixmosh
Copy link
Owner

felixmosh commented Mar 8, 2023

I think that we will go with option 2, without re-exporting the adapters (rollback).
If it makes problems more than help, we will require users to declare both of the packages in package.json.

@felixmosh
Copy link
Owner

Released in v5.0.0 since it is a breaking change.

@japrescott
Copy link
Author

Thank you for a fast resolution and sorry for my radio silence. I should have mentioned I'm on typescript.

@mariuszste
Copy link

Released in v5.0.0 since it is a breaking change.

might be a good idea to mention the breaking change in the github release description for v5.0.0. That's where a lot of people go to find breaking changes when updating. It does link to this issue, sure. But a migration guide style thing is always nice to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants