wrong signature for req.body and next()
Author: its-diboCreated Mar 2, 2025Updated Jul 28, 2026
Labelsawaiting more infotypescript
This is a regression in v5
import { NextFunction, Request, Response } from 'express';
export function someMiddleware(){
return (req: Request, res: Response, next: NextFunction) => {
// Property 'body' does not exist on type 'Request<core.ParamsDictionary, any, any, core.Query, Record<string, any>>'.ts(2339)
req.body
// Property 'method' does not exist on type 'Request<core.ParamsDictionary, any, any, core.Query, Record<string, any>>'.ts(2339)
req.method
// This expression is not callable.
// Type 'NextFunction' has no call signatures.ts(2349)
next()
}
}
Environment information
Version:
"dependencies": {
"express": "^5.0.1",
"@types/express": "^5.0.0",
}
Platform: Linux 3f32d8f1babe 6.11.0-17-generic #17~24.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 20 22:48:29 UTC 2 x86_64 GNU/Linux
Node.js version: v22.12.0
Source: expressjs/express