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 propagated from child-route to parent #2043

Closed
beowulf11 opened this issue Jul 27, 2024 · 2 comments · Fixed by #2244
Closed

Error propagated from child-route to parent #2043

beowulf11 opened this issue Jul 27, 2024 · 2 comments · Fixed by #2244

Comments

@beowulf11
Copy link

Describe the bug

I have 2 routes:

  • /$slug which displays the detail of an entity
  • /$slug/report which displays the report for the entity

Bot have loader and errorComponent on the routes as they have to load some data to display and handle errors. If an exception is thrown on /$slug/report route it displays the error from errorComponent which is to be expected. But if I navigate (via Link) to the detail /$slug it also shows the errorComponent with the same error as was thrown in the report route.

Your Example Website or App

https://stackblitz.com/edit/github-3mpcwb?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  1. Click on "Report"
  2. See error thrown on Report route
  3. Click on "Detail"
  4. See error thrown on Detail route

Expected behavior

I would expect the "Detail" route to not thrown an error as none was thrown in it.

Screenshots or Videos

CleanShot.2024-07-27.at.16.02.33.mp4

Platform

  • OS: macOS
  • Browser: Chrome
  • Version: 127.0.6533.72

Additional context

Hopefully I didn't miss some obvious

@schiller-manuel
Copy link
Contributor

regression of 1.45.3

works in 1.45.2: https://stackblitz.com/edit/github-3mpcwb-ohnkkb?file=package.json

schiller-manuel added a commit that referenced this issue Jul 27, 2024
schiller-manuel added a commit that referenced this issue Jul 27, 2024
@schiller-manuel
Copy link
Contributor

reproducer is in #2044

schiller-manuel added a commit that referenced this issue Aug 27, 2024
schiller-manuel added a commit to cristi-lng/tanstack-router that referenced this issue Sep 2, 2024
schiller-manuel added a commit that referenced this issue Sep 2, 2024
…dy (#2244)

* fix(react-router)(issue-2162): reset error boundary after the new matches are ready

* tests: reproducer for #2043

---------

Co-authored-by: Cristian Langa <cristian.langa@flywire.com>
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants