You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please provide us with the versions of the types you're using, the version of Express you're using, and an example of the code you're using that could serve as a reference
The error suggests that your error handler returns Response, but the errorHandler above has no return and its return type is void.
I'm assuming that you are using types for Express 5, which require return type of void | Promise<void> for [error] request handlers, the code that you really use is different from your example above and it returns Response (e.g. return res.json({ /* ... */ }). If that is the case, this comment explains the behaviour: #5987 (comment)
The error suggests that your error handler returns Response, but the errorHandler above has no return and its return type is void.
I'm assuming that you are using types for Express 5, which require return type of void | Promise<void> for [error] request handlers, the code that you really use is different from your example above and it returns Response (e.g. return res.json({ /* ... */ }). If that is the case, this comment explains the behaviour: #5987 (comment)
I'm trying to use an error-handling middleware with Express and TypeScript, but I'm getting a TypeScript error:
The text was updated successfully, but these errors were encountered: