-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
req.files empty on nodejs 14 #29
Comments
Thanks for the report. It does indeed seem to be that issue. And it looks like there is already a PR with a fix on the Node.js repo. |
14.1.0 got released and above issue was closed but I am still getting the same issue 🤔 https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V14.md#14.1.0 |
Thanks. I just downloaded and testing 14.1.0 and the issue is still something wrong in the |
@dougwilson thanks 👍 |
Does this library anywhere along the dependency chain use |
Could this be related to |
No, it does not. It seems there are two main issues: (1) the error from writing too much to I can fix (2) in multiparty, but struggling on how to fix (1). |
Hmm, I just tried setting |
Yea, that's a problem. Calling EDIT: I guess we could maybe somehow add some kind of legacy fallback hack in Node but it won't be pretty.
Is it incorrectly emitting it? |
Hmm, is that an error? The
I'm not sure yet, but that is the primary reason why the files are always empty here. |
This comment has been minimized.
This comment has been minimized.
So what happens here is:
As far as I can see there is no way around this without modifying fd-slicer. |
Yea. I even modified |
Where does that happen? I only saw in the Node.js source it looking at the |
Right, but that is on the writablestate object, right? Not the writable object. |
Which is a setter that modifies the state: I think it might be possible to remove this condition in Node which would resolve this issue if |
Ah. I was also looking at the Node.js docs and it looks like the |
Related nodejs/node@311e12b |
I'm still curios about what exactly you determine has changed here in v14. |
Sorry, that is my fault, I misspoke; the stream which is emitted close is the form stream (a writable). Using autoClose false fixes that (as multiparty module opens fds and so the writable shouldn't close until the underlying fds it is writing to is closed). |
Anyway @barisusakli , it sounds like the breakage here is expected and the path forward will be I likely need to rewrite multiparty to remove the fd-slicer dependency. I will try to get that done this week. |
@dougwilson I've made a fork of fd-slicer fixing compability issues in case that's any help for you https://github.com/ronag/node-fd-slicer. |
Thank you, but it is not of use to this module without support down to Node.js 0.10, as this module and multiparty support those. Ideally I would like to release this fix as a patch version vs a major version update. |
Maybe you could drop support to 0.10? I mean, that's really, really, really old and reached EOL for a while now. It's really hard to keep support to things that are too old. Or maybe you could keep MP 4 supporting those and up to 12 and MP 5 supporting node 14+. |
Hi @dougwilson, just a (very) gentle reminder about this issue 😊 |
+1 for some updates |
Hey @julianlam , @sw360cab , and everyone, sorry for the lack of updates; some life events occurred and I just got back into GitHub / open source things a couple days ago. I pretty much have all the fixes ready for this, and just working to get them published out asap. I am setting myself a timeline for this particular issue to be done by this weekend, if that helps. |
Hi @dougwilson sorry for hearing a mix of bad and good news. This is a though period. I just wanted some news to decide whether to go for another path or wait to any fix. A couple week for me is a good timeline. Thanks for your help. |
@sw360cab I know this adds literally nothing to the discussion but I have a morbid curiosity: why are you running node 13 in production? |
@StephenLynx simply because I have containerized applications which base images are still aligned with Node v13 |
Its a node version issue ,i had node 14 installed and it was not working ,so I switched to node 12 and it worked |
Yes, it is i have node v14.4.0 which gives an empty object in req.files |
Fixed in pillarjs/multiparty#226 |
For those following what @barisusakli is referring to, |
@dougwilson Great news! I have just tested and I can confirm it works. For those already working with the previous version, I suggest to clean your environment by removing |
@dougwilson can you bump the version to force the upgrade? |
multiparty在后续版本已经修复 |
I have a feeling this might be a nodejs 14 issue, maybe related to nodejs/node#33050 not sure.
Same code works on node 12.x. On nodejs 14 req.files is just an empty object. Simple app to reproduce below.
The text was updated successfully, but these errors were encountered: