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

@bull-board/[email protected] typings error #289

Closed
AntoineMaitre opened this issue Jun 2, 2021 · 10 comments · Fixed by #290 or #292
Closed

@bull-board/[email protected] typings error #289

AntoineMaitre opened this issue Jun 2, 2021 · 10 comments · Fixed by #290 or #292

Comments

@AntoineMaitre
Copy link

Hello,

First of all thank you for what you have implemented so far on this project 👍

I encountered the following errors in CI environment:

node_modules/@bull-board/api/typings/app.d.ts:1:29 - error TS2307: Cannot find module '../src/queueAdapters/base' or its corresponding type declarations.
1 import { BaseAdapter } from '../src/queueAdapters/base';
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@bull-board/api/typings/app.d.ts:2:26 - error TS2307: Cannot find module '../src/constants/statuses' or its corresponding type declarations.
2 import { STATUSES } from '../src/constants/statuses';

It looks like the imports of the typings are referencing the source code instead of the built one, or am I missing something ? 🤔

Thanks in advance for your insights !

@felixmosh
Copy link
Owner

What is the code you are trying to compile / run?

@AntoineMaitre AntoineMaitre changed the title @bull-board/api typings error @bull-board/[email protected] typings error Jun 2, 2021
@AntoineMaitre
Copy link
Author

AntoineMaitre commented Jun 2, 2021

What is the code you are trying to compile / run?

I've just updated the title with the version, if this is what you're asking about, it is @bull-board/[email protected]

Update note: I also reproduce locally when building my code using the package

@felixmosh
Copy link
Owner

Can you share the code that uses @bull-board?

@AntoineMaitre
Copy link
Author

I'm using NestJS ^7.5.1 by the way, here's the code:

import { MiddlewareConsumer, Module } from '@nestjs/common';
import { Queue } from 'bull';
import { BullModule, InjectQueue } from '@nestjs/bull';
import { createBullBoard } from '@bull-board/api';
import { BullAdapter } from '@bull-board/api/bullAdapter';
import { ExpressAdapter as BullBoardExpressAdapter } from '@bull-board/express';
import { QueueService } from './queue.service';

@Module({
    imports: [
        BullModule.registerQueue(
            {
                name: 'queue1'
            },
            {
                name: 'queue2'
            }
        )
    ],
    providers: [QueueService],
    exports: [QueueService]
})
export class QueueModule {
    private bullBoardExpressAdapter: BullBoardExpressAdapter;
    constructor(
        @InjectQueue('queue1')
        private readonly queueOne: Queue,
        @InjectQueue('queue2')
        private readonly queueTwo: Queue
    ) {
        /* relevant code related to bull-board below*/
        this.bullBoardExpressAdapter = new BullBoardExpressAdapter();
        createBullBoard({
            queues: [
                new BullAdapter(this.queueOne, { readOnlyMode: false }),
                new BullAdapter(this.queueTwo, { readOnlyMode: false })
            ],
            serverAdapter: this.bullBoardExpressAdapter
        });
    }

    configure(consumer: MiddlewareConsumer): void {
        this.bullBoardExpressAdapter.setBasePath('/status/queues');
        const router = this.bullBoardExpressAdapter.getRouter();
        consumer.apply(router).forRoutes('/status/queues');
    }
}

Let me know if it helps,

@felixmosh
Copy link
Owner

Thanx for pointing out this issue, looks like it will be solved in the next release (v3.2.4)

@felixmosh
Copy link
Owner

@AntoineMaitre can you confirm that v3.2.4 solved your issue?

@AntoineMaitre
Copy link
Author

AntoineMaitre commented Jun 2, 2021

Thanks for your quick reply and release 🚀

v3.2.4 Solved the previous error, but there's a new one though:

node_modules/@bull-board/express/dist/ExpressAdapter.d.ts:1:112 - error TS2307: Cannot find module '@bull-board/api/typings/app' or its corresponding type declarations.

1 import { AppControllerRoute, AppViewRoute, BullBoardQueues, ControllerHandlerReturnType, IServerAdapter } from '@bull-board/api/typings/app';

@felixmosh
Copy link
Owner

Checking....

felixmosh added a commit that referenced this issue Jun 2, 2021
@felixmosh
Copy link
Owner

Can you test v3.2.5?

@AntoineMaitre
Copy link
Author

v3.2.5 fixes the compiling errors 🚀

Thank you very much for your reactivity, and nice job !

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