FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add missing function argument to remove runtime error on linux desktop by mattdawkins · Pull Request #1556 · Kitware/dive · GitHub

/ dive Public

Add missing function argument to remove runtime error on linux desktop - #1556

Merged
BryonLewis merged 1 commit into
mainfrom
dev/fix-runtime-error-lin-desktop
Dec 11, 2025
Merged

BryonLewis merged 1 commit into
mainfrom
dev/fix-runtime-error-lin-desktop

Conversation

mattdawkins commented Dec 11, 2025
edited
Loading

Copy link
Copy Markdown
Member

I get the following error on the latest release of DIVE when running a long-running stereo pipeline.

This is an Express error handler but it has the wrong signature. Express error handlers need 4 parameters: (err, req, res, next). With only 3 parameters, Express treats it as a regular middleware and passes (req, res, next) - so the request object becomes err, the response object becomes req, and next becomes res.

Update(client/platform/desktop/backend/server.ts)
Updated client/platform/desktop/backend/server.ts with 2 additions
211 err: { status?: number; statusMessage?: string },
212 req: express.Request,
213 res: express.Response,
214 + // eslint-disable-next-line @typescript-eslint/no-unused-vars
215 + next: express.NextFunction,
216 ) {
217 res.status(err.status || 500).json({ message: err.statusMessage || err });
218 }

The fix is adding the next parameter. In Express, error-handling middleware must have exactly 4 parameters (err, req, res, next) for Express to recognize it as an error handler. Without next, Express was treating fail as regular middleware and passing (req, res, next) instead of (err, req, res, next), causing res to be in the req position and the actual next function to be in the res position.

When the code then called res.status(500), it was actually calling next.status(500) - and next is a function, not a response object, which is why you got TypeError: n.status is not a function.

BryonLewis self-requested a review December 11, 2025 16:52

BryonLewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Just tested locally building and restarted the Github Actions and it built.
Nice find and I think I might have normally ignored it because I typically don't have long running tasks.

BryonLewis merged commit 5d2c382 into main Dec 11, 2025
5 of 8 checks passed
BryonLewis deleted the dev/fix-runtime-error-lin-desktop branch December 11, 2025 17:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL