Link to the code that reproduces this issue
https://github.com/chargome/repro.next-16-proxy-errors
To Reproduce
Reproduction steps are outlined in the repro readme.
Current vs. Expected behavior
- Throwing errors from within a
proxy.ts file do not get reported via onRequestError ❌
- Throwing errors from within a
middleware.ts file do get reported via onRequestError ✅
I would expect the error reporting to behave identically between these two files.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000
Available memory (MB): 32768
Available CPU cores: 10
Binaries:
Node: 20.14.0
npm: 10.7.0
Yarn: 1.22.22
pnpm: 9.4.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/A
Which area(s) are affected? (Select all that apply)
Middleware
Which stage(s) are affected? (Select all that apply)
next start (local), next dev (local), Vercel (Deployed)
Additional context
No response
Link to the code that reproduces this issue
https://github.com/chargome/repro.next-16-proxy-errors
To Reproduce
Reproduction steps are outlined in the repro readme.
Current vs. Expected behavior
proxy.tsfile do not get reported viaonRequestError❌middleware.tsfile do get reported viaonRequestError✅I would expect the error reporting to behave identically between these two files.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000 Available memory (MB): 32768 Available CPU cores: 10 Binaries: Node: 20.14.0 npm: 10.7.0 Yarn: 1.22.22 pnpm: 9.4.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)
Middleware
Which stage(s) are affected? (Select all that apply)
next start (local), next dev (local), Vercel (Deployed)
Additional context
No response