router icon indicating copy to clipboard operation
router copied to clipboard

Error propagated from child-route to parent

Open beowulf11 opened this issue 1 year ago • 2 comments

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

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

beowulf11 avatar Jul 27 '24 14:07 beowulf11

regression of 1.45.3

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

schiller-manuel avatar Jul 27 '24 15:07 schiller-manuel

reproducer is in #2044

schiller-manuel avatar Jul 27 '24 15:07 schiller-manuel