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)
Not relevant
Describe the Bug
I am facing an issue with large post body with middleware, If the post body size is larger than 64k it hangs the client for a long time and is not processed. I zeroed it down on issue with middleware. If I introduce the middleware (even that does not do anything), than the post request does not succeed.
Steps to reproduce.
Create a brand new project using create-next-app
Create a middleware.js file in root of the project
export function middleware(request) {
console.log(request.url);
}
Start the above server using
npm run dev
Start another terminal session
Install axios
npm install axios
Create a file in root testRequest.js, needs axios as dependency
Codesandbox, will automatically run the base nextjs project.
Open another terminal tab in Codesandbox.
Execute node testRequest.js, it should print the url in nextjs terminal tab, however the execution of the node program will hang. Kill this program. This file generates request of 100kb in size hence it hangs.
Execute node testRequestLessThan64.js, this should succeed and print a message in console.
The text was updated successfully, but these errors were encountered:
A similar issue was raised here #39262 (comment) where a post request of 16kb and larger body resulted in a pending state. See if v12.2.2 works if you can downgrade temporarily. That version has fixed my issue.
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
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Wed Aug 25 23:20:18 UTC 2021
Binaries:
Node: 18.3.0
npm: 8.11.0
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.2.6-canary.0
eslint-config-next: 12.2.5
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
Not relevant
How are you deploying your application? (if relevant)
Not relevant
Describe the Bug
I am facing an issue with large post body with middleware, If the post body size is larger than 64k it hangs the client for a long time and is not processed. I zeroed it down on issue with middleware. If I introduce the middleware (even that does not do anything), than the post request does not succeed.
Steps to reproduce.
If I reduce the request size by changing multiple in repeat to 63, the request will not hang and 404 error response will be returned.
Expected Behavior
Expected behavior is that on running the testRequest, I should immediately get 404 response and an error message should be consoled.
However if the request is larger than 64k, it hangs and does not print the error.
Link to reproduction
https://codesandbox.io/s/mutable-flower-z3qgzd?file=/testRequest.js
To Reproduce
The text was updated successfully, but these errors were encountered: