Skip to content

no stack trace for App Promise Reject with non-Error reasons #77351

Open
@samijaber

Description

@samijaber

Link to the code that reproduces this issue

https://github.com/samijaber/nextjs-reject-bug-repro/

To Reproduce

  1. https://github.com/samijaber/nextjs-reject-bug-repro/
  2. npm run dev
  3. open / and see error message
  4. toggle the two different promises to compare stack traces https://github.com/samijaber/nextjs-reject-bug-repro/blob/ea125b442fbb275efcb3341fa70a4f2199395708/src/app/page.tsx#L112-L117

Current vs. Expected behavior

When a Promise reject has an Error reason:

Image

When a Promise reject has a non-Error reason (an arbitrary object):

Image

note how we lose information on where the rejection is coming from.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.2.0: Fri Dec  6 19:01:59 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 20.11.0
  npm: 10.2.4
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 15.2.3 // Latest available version is detected (15.2.3).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.8.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)

next dev (local)

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