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
{{ message }}
Repository navigation
fix(router-core): handle matches whose routes are removed from routeTree #7797
Applications can replace routeTree while existing, pending, or cached matches still reference routes removed from the new tree.
Route lookups through looseRoutesById[match.routeId] then return undefined. This can crash cache cleanup, Devtools age rendering, and lifecycle callback dispatch.
Scope
Evict cached matches whose route no longer exists during clearExpiredCache.
Make Devtools AgeTicker render nothing for an orphaned match.
Skip lifecycle callback dispatch for matches whose route has been removed.
Preserve existing behavior for current routes and for routes without loaders.
Add router-core regression coverage that loads a route, replaces the route tree without it, and completes a navigation or cache-cleanup cycle without throwing.
Add focused Devtools coverage for an orphaned match in AgeTicker.
Hi @LadyBluenotes — happy to take this on if it's still open.
One thing I want to check before starting:
after the loader rewrite (#7805), the routesById lookup lives in getRoute() (load-client.ts), which currently returns AnyRoute (non-optional) and ends in a ! assertion.
Fixing this at the root means widening the return type to AnyRoute | undefined and adding early returns at every call site — plus the same guard in runRouteLifecycle() and AgeTicker.tsx. Is that the scope you had in mind, or would you rather keep the return type as-is and guard only at the specific crash sites?
Activity
constantly-dev commentedon Aug 31, 2026
Hi @LadyBluenotes — happy to take this on if it's still open.
One thing I want to check before starting:
after the loader rewrite (#7805), the
routesByIdlookup lives ingetRoute()(load-client.ts), which currently returnsAnyRoute(non-optional) and ends in a!assertion.Fixing this at the root means widening the return type to
AnyRoute | undefinedand adding early returns at every call site — plus the same guard inrunRouteLifecycle()andAgeTicker.tsx. Is that the scope you had in mind, or would you rather keep the return type as-is and guard only at the specific crash sites?Can you assign this to me?