Skip to content

Next.js 16 does not forward proxy errors to onRequestError #85261

@chargome

Description

@chargome

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    MiddlewareRelated to Next.js Middleware.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions