We believe these changes will fix the failing build and test:unit tasks. The new getLinkLocationStore helper cast router.stores.location directly to LocationSource, but within router-core's own compilation the RouterWritableStore type has no subscribe member (that member only appears once a framework adapter's module augmentation, e.g. react-router's routerStores.ts, is in scope), so TS2352 correctly flagged the cast as insufficiently overlapping. Routing the cast through unknown first — exactly as the compiler suggested — keeps the intended runtime behavior while satisfying the type checker. Separately, the new test's calls[index]++ tripped noUncheckedIndexedAccess since indexed reads are typed as possibly undefined; a non-null assertion resolves it since index is always within the fixed-size array's bounds.
This code change can't be applied
A fix is available, but it can't be applied automatically because the branch is outdated. Please sync the branch, then apply the fix locally below.
Self-Healing CI
Classification: Code change needed
Fix generated
Verified 2 tasks
Commit"fix(router-core): fix type errors in link-location store"
2 files changed
+124/−43