-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
formidable is stuck at parse function's callback #948
Comments
Just came here with the exact same use case. The callback never resolves, no error either. Just to make it simpler without all the postman/insomnia UI:
Results in |
Try again with node v20, and without express |
@GrosSacASac just curious but... why? The docs say |
Yes, but first of all we need to find the source of the problem. Since it works for me (I just tested the curl example) I conclude that it must something that we have different. which is node version or express. Once we find the source of the problem we can try to find the solution or update the docs |
Face the same issue today, but it turned out I forget to disable the nextjs bodyParser. export const config = {
api: {
bodyParser: false,
},
}; |
I have found the main issue for my case. It wasn't because of the Node version or the Express version, but instead on which I ran my Express app: Google Cloud Functions. It turns out that Google Cloud Functions implement some middleware that converts inputs that are files into raw data type (Buffer) in At the same time, I tried running Formidable on a regular Express app and it worked with the Node version I provided in the original issue submission. For others facing the same issue, you can instead parse the raw data using Busboy. |
Next time test locally before making an issue. Someone made https://github.com/Amit-A/formidable-serverles that uses req.rawBody. I am not sure that it is a clean solution. |
related #594 |
Sorry to resurrect this, but shouldn't formidable throw some kind of error if it can't parse the request? Would a PR exposing the error be accepted? Could blow things up, but it's better than silent failure. |
Support plan
Context
What are you trying to achieve or the steps to reproduce?
I am trying to create an API endpoint that accepts uploading an Excel file in Node.js with Express and Formidable. After uploading the Excel file, I will parse the content of the file with another package to insert the parsed data to MongoDB using Mongoose. Currently, I am stuck at the
parse
function of Formidable.To call the API endpoint on Postman, here's what I did. The uploaded file is 15KB.


What was the result you got?
The request got stuck when I tried to hit that API endpoint using Postman. It does log the
console.log(form)
statement, but anything beyond that seems to never run.What result did you expect?
To be able to log what
fields
andfiles
contain as well as sending ahi
as a response in Postman.The text was updated successfully, but these errors were encountered: