felixmosh / bull-board

🎯 Queue background jobs inspector
MIT License
2.36k stars 366 forks source link

`createBullBoard`'s `serverAdapter` and `ExpressAdapter` types don't match #779

Closed s-lukashenka-micoworks closed 4 months ago

s-lukashenka-micoworks commented 5 months ago

Current behavior:

@bull-board/api version: 5.20.4

I am seeing the following type error with serverAdapter when using the expressjs way:

Screenshot 2024-06-25 at 11 18 28

Desired behavior

No type mismatch error observed.

felixmosh commented 5 months ago

Hi, can you share you code snippet?

felixmosh commented 5 months ago

This example.ts file is the entry point of the dev env. It is working as expected, Typescript wise.

Can you check if your code is different?

Dremora commented 5 months ago

This error started occurring for me after upgrading to the latest TypeScript v5.5.2.

felixmosh commented 5 months ago

Let me check this....

felixmosh commented 5 months ago

I've updated to Typescript 5.5.2, it shows some errors on UI, but not inside the adapter... as yours Can you prepare a small repo that reproduces this?

image

Compiled successfully with TS 5.5.2

felixmosh commented 5 months ago

Pay attention, you have 2 versions of the lib.... image Try to clean install it.

Dremora commented 5 months ago

Indeed, for some reason there were two (identical) versions present for me as well. This is likely due to a bug in pnpm. Upgrading pnpm from v7 to v9 fixed this for me. Weirdly enough, two copies were not an issue before TypeScript upgrade.

felixmosh commented 5 months ago

@Dremora, Is this solved for now?

Dremora commented 4 months ago

@felixmosh it got resolved for me by upgrading pnpm to the latest version. I'd suggest @s-lukashenka-micoworks trying the same.