Error propagated from child-route to parent
Describe the bug
I have 2 routes:
-
/$slugwhich displays the detail of an entity -
/$slug/reportwhich 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
- Click on "Report"
- See error thrown on Report route
- Click on "Detail"
- 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
https://github.com/user-attachments/assets/acf445a9-cd93-4c04-9686-d5d0498f727e
Platform
- OS: macOS
- Browser: Chrome
- Version: 127.0.6533.72
Additional context
Hopefully I didn't miss some obvious
regression of 1.45.3
works in 1.45.2: https://stackblitz.com/edit/github-3mpcwb-ohnkkb?file=package.json
reproducer is in #2044