-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
Description
Reproduction
- Upload a file via multipart/form-data that exceeds the available memory capacity of the environment.
- Convert the request into FormData using
parseFormData
(@remix-run/form-data-parser).
cf. https://reactrouter.com/how-to/file-uploads
System Info
N/A
Used Package Manager
npm
Expected Behavior
The request should be correctly converted into FormData.
Actual Behavior
The process crashes because it attempts to allocate memory equal to the file size.
This seems to be caused by MultipartParser
(@remix-run/multipart-parser) creating a buffer for each part.
cf. https://github.com/mjackson/remix-the-web/blob/88b3716a6eb0b0dcd8ef1e4b5051ccd00593d819/packages/multipart-parser/CHANGELOG.md
Is this a deliberate limitation in react-router to only handle small files?