Middleware is causing POST/PUT requests with large payload to stuck
See original GitHub issueVerify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64
Binaries:
Node: 16.14.0
npm: 8.5.0
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.2.6-canary.8
eslint-config-next: 12.2.5
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
next run dev
Describe the Bug
When middleware.ts
is present, POST and PUT requests with large payloads to any apis in the pages/api
folder are stuck on pending
.
The payload I was using has Content-Length: 30233
, so even if in default api setting it should not be too big.
Expected Behavior
POST and PUT requests should be working with middleware present.
Link to reproduction
https://github.com/louisesiqifan/next-js-huge-post
To Reproduce
- Run
npm i
- Run
npm run dev
- In http://localhost:3000/, click the two buttons
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:5
Top Results From Across the Web
`await call_next(request)` gets stuck indefinitely on larger ...
When implemented, response = await call_next(request) gets stuck indefinitely when the JSON payload is too large. What could be the reason?
Read more >HTTP request methods - MDN Web Docs
Chrome Edge
CONNECT Full support. ChromeYes. Toggle history Full support. Edge12. Toggle history
DELETE Full support. ChromeYes. Toggle history Full support. Edge12. Toggle history
GET Full...
Read more >Nodejs Security - OWASP Cheat Sheet Series
However, fixing a request size limit for all requests may not be the correct behavior, since some requests may have a large payload...
Read more >NetSuite Applications Suite - SuiteTalk REST Web Services ...
Common Causes of Site Performance Issues · Reduce Repeated Calls with ... a simple portlet that posts data to a servlet · GET,...
Read more >Node.js Express: JWT example | Token Based Authentication ...
JWT Authentication Middleware: verify SignUp, verify token ... sends request for an endpoint using HTTP request (GET, POST, PUT, DELETE), ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think this is a dup of https://github.com/vercel/next.js/issues/39262
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.