-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Description
Reproduction
Following up on our discussion in #13766 (comment)
I've updated the reproduction to use v7.8.0 — you can check it out here:
👉 https://stackblitz.com/edit/github-ka7tf4zb-fqjd8nkf?file=app%2Froutes%2Findex.tsx
System Info
v7.8.0Used Package Manager
npm
Expected Behavior
✅ Expected behavior :
-
When navigating to a route whose middleware throws and which exports an error boundary, the error should be caught and displayed by that route’s error boundary.
-
If no error boundary is defined on that route, the error should propagate up the route hierarchy and be caught by the nearest parent boundary. Such as a layout-level or root-level boundary.
-
This behavior should be consistent whether the navigation happens during initial render or after the app has loaded.
Actual Behavior
❌ Unexpected behavior with v7.8.0:
-
When navigating to a route with throwing middleware and an exported error boundary, the error is not caught by the route’s boundary.
-
Instead, the error bypasses all nested boundaries (including layout-level ones) and is caught by the root error boundary.