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

Job results do not appear when using express 5 #404

Open
CJEnright opened this issue Apr 25, 2022 · 2 comments
Open

Job results do not appear when using express 5 #404

CJEnright opened this issue Apr 25, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@CJEnright
Copy link

CJEnright commented Apr 25, 2022

When using express 5 job results can no longer be seen:
Screen Shot 2022-04-24 at 22 03 40

I've tracked this down to a breaking change in express 5 where req.query has become a getter, whereas in express 4 it was set as part of a middleware function:

This leads to req.query being undefined in libraries that pull in express 4 (like bull-board). For bull-board this causes no active queue to be selected, and so no jobs for that queue are returned. I think this could be fixed if we were to set the express dependency to >=4.17.3.

In the meantime, this can be used as a somewhat hacky workaround:

router.use(
	"/queues",
	(req: Request, res: Response, next: NextFunction) => {
		const query = req.query;
		// Set query as a property on req instead of as a getter for backwards
		// compatibility with express 4
		Object.defineProperty(req, "query", { get: () => query });
		next();
	},
	serverAdapter.getRouter()
);
@felixmosh
Copy link
Owner

felixmosh commented Apr 25, 2022

Bull-board is not supports express v5 since it is not an official version yet.

It is easy to add, but I'm not sure about the demand of it.

Let's vote on this issue, if we will pass 30 likes, I will add it.

@stale
Copy link

stale bot commented Jul 24, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 24, 2022
@stale stale bot closed this as completed Aug 1, 2022
@felixmosh felixmosh added the enhancement New feature or request label Aug 1, 2022
@felixmosh felixmosh reopened this Aug 1, 2022
@stale stale bot removed the wontfix This will not be worked on label Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants