Middleware Caches Uploaded Files In Memory #65563
Labels
bug
Issue was opened via the bug report template.
Middleware
Related to Next.js Middleware
Performance
Anything with regards to Next.js performance.
Link to the code that reproduces this issue
https://github.com/KakkoiDev/try-memory-efficient-nextjs-upload-proxy
To Reproduce
NEXT_PUBLIC_UPLOAD_URL
path, to avoid using the middleware to validate the issue disappearsCurrent vs. Expected behavior
Current
As the file uploads, the sent chunks are cached in memory and not released.
Expected behavior
As the data stream is sent to the server, the cached chunks are released from memory.
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 4 14:39:20 UTC 2 Available memory (MB): 32012 Available CPU cores: 6 Binaries: Node: 20.12.2 npm: 10.5.0 Yarn: 1.22.22 pnpm: 9.1.0 Relevant Packages: next: 14.2.3 // Latest available version is detected (14.2.3). eslint-config-next: 14.2.3 react: 18.3.1 react-dom: 18.3.1 typescript: 5.4.5 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Middleware, Performance
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
My whole team experiences the same issue on their own computers.
The text was updated successfully, but these errors were encountered: