oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
71.85k stars 2.56k forks source link

express-fileupload stuck while file upload #5622

Open Ja4V8s28Ck opened 9 months ago

Ja4V8s28Ck commented 9 months ago

What version of Bun is running?

1.0.2+37edd5a6e389265738e89265bcbdf2999cb81a49

What platform is your computer?

Linux 6.4.0-kali3-amd64 x86_64 unknown

What steps can reproduce the bug?

The bug is when I try to use express-fileupload to upload an "image", it's stuck on uploading. I believe the problem is that busboy is not parsing or can't parse the data buffer sent.

To replicate the issue, I used the example files given by express-fileupload

What is the expected behavior?

I enabled the debug option in express-fileupload to troubleshoot and know what went wrong. I ran index.js with nodemon again and saw the following.

correct

What do you see instead?

While using bun, this happened

wrong

Additional information

I think something went wrong with the busboy parsing.

andres-linares commented 9 months ago

I am going through the same issue. Somehow using Postman and adding the file directly works but when sending images from reactnative creating a FormData it gets stuck

Ja4V8s28Ck commented 9 months ago

I believe the bug has been fixed in the newest version of Bun (1.0.3+25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a).

andres-linares-int commented 9 months ago

I'm still having the same issue

Ja4V8s28Ck commented 9 months ago

I'm still having the same issue

I've re-opened the issue

PsiKai commented 9 months ago

Commenting for reach and updates. I am experiencing the exact same issue on 1.0.3+25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a

augustomegres commented 9 months ago

Same here, i tried to run my app with ts-node-dev, and work perfectly, but when i run with bun, only upload of smallest files (20kb) works.

kartojal commented 9 months ago

Same here, with express.js and express-fileupload, which uses busboy as dependency. The issue is that it doesnt show any error logs, it just hangs without exiting.

beytarovski commented 8 months ago

I install bun 1.0.7 and it works 🧤🎉

PsiKai commented 8 months ago

I can confirm that 1.0.7 does make this work.

However, if I use the useTempFiles option passed to fileupload, it still has the same symptom of hanging indefinitely while parsing larger files. I believe this is due to how busboy is creating a read/write stream to write the file to disk. I can reproduce the described issue while using a busboy-only implementation on Bun 1.0.7

bnussman commented 8 months ago

I think https://github.com/flash-oss/graphql-upload-minimal is similly not working. It also depends on busboy.