-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Reproduction
System Info
System:
OS: macOS 14.8.1
CPU: (10) arm64 Apple M1 Pro
Memory: 98.63 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.5.1 - ~/Library/Caches/fnm_multishells/38932_1759406901915/bin/node
Yarn: 3.2.1 - ~/Library/Caches/fnm_multishells/38932_1759406901915/bin/yarn
npm: 9.8.0 - ~/Library/Caches/fnm_multishells/38932_1759406901915/bin/npm
Browsers:
Chrome: 141.0.7390.55
Safari: 26.0.1
npmPackages:
@react-router/dev: 7.9.2 => 7.9.2
@react-router/express: 7.9.2 => 7.9.2
@react-router/node: 7.9.2 => 7.9.2
@react-router/remix-routes-option-adapter: 7.9.2 => 7.9.2
@react-router/serve: 7.9.2 => 7.9.2
react-router: 7.9.2 => 7.9.2
vite: ^6.3.5 => 6.3.5Used Package Manager
yarn
Expected Behavior
From the docs, it seems like middleware should behave the same as loaders/actions. If a child loader/action errors, then the parent route is still rendered but the child route renders an error boundary.
I was expecting middleware to act in exactly the same way.
Actual Behavior
From debugging locally, when a child route middleware throws an error this branch is called:
| // We never even got to the handlers, so we've got no data - |
If the highest parent has a loader than it will defer to the error boundary of that parent I guess because none of the loader data has been collected.
I am looking for feedback on this though, perhaps my usage in the example is wrong?