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

Error boundary for parallel route not catching errors. #62954

Closed
PupoSDC opened this issue Mar 6, 2024 · 3 comments
Closed

Error boundary for parallel route not catching errors. #62954

PupoSDC opened this issue Mar 6, 2024 · 3 comments
Labels
bug Issue was opened via the bug report template. locked

Comments

@PupoSDC
Copy link

PupoSDC commented Mar 6, 2024

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/sweet-satoshi-pfvnzh?file=%2Fapp%2Flayout.tsx

To Reproduce

  1. create a page with a parallel route
  2. add an error.tsx the parallel route
  3. throw an error in the page.tsx
  4. the whole app crashes.

On the sandbox the error can be reproduced when visiting /issue

Current vs. Expected behavior

Relevant Docs.

The sandbox contains a /no-issue which includes a page that throws an error and an error boundary that renders correctly. According to the docs the same pattern should work for a slot.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 14.1.2
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A


(this is from the sandbox)

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

App Router

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

next dev (local)

Additional context

I have a slot on my application that is dynamic and depends on query params. The slot should throw an error when the Params don't make sense, so that an error boundary is shown. I tried doing a simialr implementation using notFound and I have the same problem. it also does not work.

@PupoSDC PupoSDC added the bug Issue was opened via the bug report template. label Mar 6, 2024
@damian-balas
Copy link

damian-balas commented Mar 18, 2024

Same here. Putting error.tsx inside @folder doesn't work at all. It takes the top error.tsx file.

@ztanner
Copy link
Member

ztanner commented Apr 10, 2024

Hi @PupoSDC! Thanks for the report. I tested your CodeSandbox with latest canary and it seems like the issue was resolved.

CleanShot.2024-04-10.at.08.25.37.mp4

Going to close out this issue now, but please let us know if you're still encountering issues here!

@ztanner ztanner closed this as completed Apr 10, 2024
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked
Projects
None yet
Development

No branches or pull requests

3 participants