You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When navigating from a route that has an error (whether render or loader error) the destination route receives that error in errorComponent.
In minimal reproduction attached, I have three routes:
index (never throws)
render-error (always throws an error during render)
loader-error (always throws an error in loader).
The index route never throws, but despite that, its errorComponent receives the error of render-error or loader-error when navigating to it, as seen in this recording:
2026-04-08.14-39-35.mp4
Without looking at the logs the issue is not noticeable, as the index.errorComponent doesn't actually render. However, if errorComponent happens to throw (e.g. to let another error boundary handle it) then it will render a parents errorComponent, and the issue becomes apparent:
Which project does this relate to?
Router
Describe the bug
When navigating from a route that has an error (whether render or loader error) the destination route receives that error in
errorComponent.In minimal reproduction attached, I have three routes:
index(never throws)render-error(always throws an error during render)loader-error(always throws an error in loader).The
indexroute never throws, but despite that, itserrorComponentreceives the error ofrender-errororloader-errorwhen navigating to it, as seen in this recording:2026-04-08.14-39-35.mp4
Without looking at the logs the issue is not noticeable, as the
index.errorComponentdoesn't actually render. However, iferrorComponenthappens to throw (e.g. to let another error boundary handle it) then it will render a parentserrorComponent, and the issue becomes apparent:2026-04-08.14-38-22.mp4
Your Example Website or App
https://github.com/ali-idrizi/tanstack-router-error-boundary-leak
Steps to Reproduce the Bug or Issue
errorComponentconsole.errorrunning despite the Home route never throwing an errorExpected behavior
The error from the previous route should not leak to an unrelated route
Screenshots or Videos
No response
Platform
Additional context
No response