-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Requests with form-data
or x-www-form-data-urlencoded
returns error
#58152
Comments
This is impacting my application which is using inbound webhooks from Slack. I'm trying to receive the call using a Route Handler registered for My application logs |
what's the usecase? |
The usecase is using data from |
Same issue. I have a POST endpoint that is supposed receive files as form data. It works if do just that, but as soon as I import and try to use logic to process those files I get this error. I'm not sure what exactly is causing this. Importing Prisma is fine. Do these app router endpoints have anything special about how they are compiled? My runtime is explicitly set to 'nodejs' |
I was able to trace it to this package: https://github.com/AIDungeon/GPT-3-Encoder Removing import & usage fixed the issue 🤔 |
When sending post requests but it's not server action, skip logging warning or calling non-existed server action. Instead we only log the warning like missnig headers for server actions when it's a server action and call the action handler when it's decoded as a function Fixes #58152 Closes NEXT-1761
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Link to the code that reproduces this issue
https://github.com/lkimrxnt/next-formData-issue
To Reproduce
form-data
POST
request to the application with any form data:x-www-form-data-urlencoded
POST
request to the application with any form data:Current vs. Expected behavior
Current
If
form-data
orx-www-form-data-urlencoded
has been sent the application returns the error below:If
x-www-form-data-urlencoded
has been sent the equest stuck and never completesExpected
The application executes logic in the middleware, parses formData and renders root page
/
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router, Middleware / Edge (API routes, runtime)
Additional context
I've tested the same behavior using the latest version of next (14).
Important note
If I send the requests below to a page in
Pages routing
/pages/testPage
, everything works as expected.NEXT-1761
The text was updated successfully, but these errors were encountered: