Comments (9)
Face the same issue today, but it turned out I forget to disable the nextjs bodyParser.
export const config = {
api: {
bodyParser: false,
},
};
from formidable.
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 req.rawBody
(full description here: https://stackoverflow.com/a/47319614). It seems that Formidable requires the data type unmodified, and as the data is automatically modified when running on an Express app on Google Cloud Functions, I concluded that my case is not the right use case to use Formidable.
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.
from formidable.
related #594
from formidable.
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:
curl --request POST \
--url <my url> \
--header 'Content-Type: multipart/form-data' \
--form field1=eee \
--form field2=text
Results in parse
hanging.
from formidable.
Try again with node v20, and without express
from formidable.
@GrosSacASac just curious but... why? The docs say node > 10.13
is supported, and there is explicit express integration support in the docs.
from formidable.
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
from formidable.
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.
from formidable.
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.
from formidable.
Related Issues (20)
- TS Options Type Definition missing createDirsFromUploads HOT 1
- Attach fields to req.body and files to req.files like multer HOT 1
- [deps] Check for breaking changes in Dependabot PRs HOT 1
- @cunha-ambisis you should create a new form on each request (inside app.use) HOT 1
- Since V3 I get "formidable is not a function" - using require not import HOT 12
- Make multipart parser less dependent on NodeJS HOT 2
- Regression in Formidable v3, which can crash a server HOT 7
- form.parse's Promise never resolves in tests HOT 8
- Hexoid Error (?)
- Buffer usage HOT 2
- Files parsed by `IncomingForm().parse` are not automatically cleaned up or deleted. HOT 6
- firstValues export in index HOT 4
- Build giving the error in `cloudflare-pages` preset HOT 2
- maxFileSize not working as it should HOT 1
- TypeScript - Unable to access FormidableError on formidable.errors HOT 9
- Convert 'firstValues' helper into an option for Formidable constructor. HOT 2
- Support the contentType of multipart field. HOT 2
- VERSION_NOTES.md is misleading
- Engines missing in `package.json` and wrong version of Node.js supported listed in README
- How to wait for the result of writeHandler in a formidable file upload request? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formidable.