Request body can't be read when running middleware in nodejs
runtime
#77551
Labels
Middleware
Related to Next.js Middleware.
nodejs
runtime
#77551
Link to the code that reproduces this issue
https://github.com/kevva/next-bugs/tree/node-middleware-bug
To Reproduce
next dev
)POST
request with a bodyCurrent vs. Expected behavior
Current behaviour
When reading the body, the app will fail with the following error:
Expected behaviour
The middleware should be able to read the body.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.4.0: Tue Mar 4 21:05:34 PST 2025; root:xnu-11417.100.576.505.3~2/RELEASE_ARM64_T6000 Available memory (MB): 32768 Available CPU cores: 10 Binaries: Node: 23.10.0 npm: 10.2.4 Yarn: 1.22.21 pnpm: 8.15.7 Relevant Packages: next: 15.3.0-canary.24 // Latest available version is detected (15.3.0-canary.24). eslint-config-next: N/A react: 19.0.0 react-dom: 19.0.0 typescript: 5.8.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Middleware
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
This works fine when running the middleware with the Edge runtime and only happens when running it in Node.js.
The text was updated successfully, but these errors were encountered: