Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console.error in catch block triggers ErrorBoundary in strict mode when using Pages Router #75299

Open
lukasb opened this issue Jan 24, 2025 · 1 comment
Labels
Pages Router Related to Pages Router.

Comments

@lukasb
Copy link

lukasb commented Jan 24, 2025

Link to the code that reproduces this issue

https://github.com/lukasb/error-repro

To Reproduce

  1. npm run dev
  2. navigate to app

Current vs. Expected behavior

For pages router:
Current: ErrorBoundary is shown
Expected: ErrorBoundary is not shown, since error was caught

For app router:
Current: "1 error" badge shown
Expected: no badge shown, since error was caught

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 10
Binaries:
  Node: 20.18.1
  npm: 10.8.2
  Yarn: 1.22.5
  pnpm: 9.4.0
Relevant Packages:
  next: 15.1.4 // There is a newer version (15.1.6) available, upgrade recommended!
  eslint-config-next: 15.1.4
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.7.3
Next.js Config:
  output: N/A

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

Pages Router

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

next dev (local)

Additional context

see investigation and patches by @icyJoseph here: #75060 (reply in thread)

@github-actions github-actions bot added the Pages Router Related to Pages Router. label Jan 24, 2025
@akulabs8
Copy link

Hey can I pick this up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pages Router Related to Pages Router.
Projects
None yet
Development

No branches or pull requests

2 participants