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

wrong signature for req.body and next() #6370

Open
its-dibo opened this issue Mar 2, 2025 · 0 comments
Open

wrong signature for req.body and next() #6370

its-dibo opened this issue Mar 2, 2025 · 0 comments
Labels
require-triage typescript Topics related to TypeScript

Comments

@its-dibo
Copy link

its-dibo commented Mar 2, 2025

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

@its-dibo its-dibo added the bug label Mar 2, 2025
@bjohansebas bjohansebas added typescript Topics related to TypeScript require-triage labels Mar 2, 2025
@wesleytodd wesleytodd removed the bug label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
require-triage typescript Topics related to TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants