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
How are you deploying your application? (if relevant)
next start
Describe the Bug
When using a middleware, POST requests to API-routes never resolve. Commenting out the code added to next-server.ts from #34519 solves the issue. GET works as expected.
Apologies if this is a known issue, thought it would be good to bring up otherwise.
Sidenote: When setting config.api.bodyParser: false on API-routes, won't they still have been replaced in the middleware layer, or is it completely separate?
fixes#34966
Wait for reading original request body before overwriting the request properties with `originalBody?.finalize()` call since it caused the problem when middleware does not read request body
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
cURL
How are you deploying your application? (if relevant)
next start
Describe the Bug
When using a middleware, POST requests to API-routes never resolve. Commenting out the code added to
next-server.ts
from #34519 solves the issue. GET works as expected.Apologies if this is a known issue, thought it would be good to bring up otherwise.
Sidenote: When setting
config.api.bodyParser: false
on API-routes, won't they still have been replaced in the middleware layer, or is it completely separate?Expected Behavior
POST requests to api-routes to work.
To Reproduce
https://stackblitz.com/edit/nextjs-hhf3gk
The text was updated successfully, but these errors were encountered: