Skip to content

onRequestError is not triggered for middleware when runtime is nodejs #84181

@yiminghe

Description

@yiminghe

Link to the code that reproduces this issue

https://github.com/yiminghe/on-request-error-bug

To Reproduce

  1. pnpm dev
  2. open http://localhost:3000/
  3. check console

Current vs. Expected behavior

current (15.5.x, canary when runtime is nodejs):
no 'onRequestError' in console

expected(same with when not set runtime):
'onRequestError' in console

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Mon Aug 25 21:12:01 PDT 2025; root:xnu-12377.1.9~3/RELEASE_ARM64_T8132
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 22.12.0
  npm: 11.4.2
  Yarn: 1.22.22
  pnpm: 10.17.1
Relevant Packages:
  next: 15.6.0-canary.27 // Latest available version is detected (15.6.0-canary.27).
  eslint-config-next: N/A
  react: 19.1.1
  react-dom: 19.1.1
  typescript: 5.9.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Error Handling

Which stage(s) are affected? (Select all that apply)

Other (Deployed)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error HandlingRelated to handling errors (e.g., error.tsx, global-error.tsx).

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions