-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Open
Labels
MiddlewareRelated to Next.js Middleware.Related to Next.js Middleware.Server ActionsRelated to Server Actions.Related to Server Actions.
Description
Link to the code that reproduces this issue
https://github.com/nghiepdev/next16-server-action-proxy-uploadfile-mp34-bug
To Reproduce
- Run next dev.
- Select a file.
- Click Upload.
- Check the terminal — the file is missing on the first attempt.
- Click Upload again.
- The terminal now logs the file.
Current vs. Expected behavior
In development mode, when proxy.ts is configured, the first call to a server action that uploads an mp3/mp4 results in the uploaded file being missing or empty. Subsequent calls work. Image uploads do not exhibit this problem.
Expected: All file types (including mp3/mp4) should be consistently available to server actions on the first call in development, regardless of proxy configuration.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:50 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6030
Available memory (MB): 36864
Available CPU cores: 12
Binaries:
Node: 24.10.0
npm: 11.6.1
Yarn: N/A
pnpm: 10.18.0
Relevant Packages:
next: 16.0.0 // Latest available version is detected (16.0.0).
eslint-config-next: N/A
react: 19.2.0
react-dom: 19.2.0
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Server Actions, Middleware
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
Problem occurs only in development. If I remove proxy.ts, the bug no longer appears.
Also, the issue does not occur with JPEG files.
Gouttfi, Hunter-Matata, LouisCuvelier, yuriy-sng, say25 and 1 more
Metadata
Metadata
Assignees
Labels
MiddlewareRelated to Next.js Middleware.Related to Next.js Middleware.Server ActionsRelated to Server Actions.Related to Server Actions.