Skip to content
Source
Sign inSign up
TanStack/router

fix(router-core): lane match loader rewrite #7805

MergedSheraff(GitHub profile, opens in a new tab)merged 69 commits intomain fromrefs/pull/7805/headmerged by Sheraff(GitHub profile, opens in a new tab)

fixed by this PR

fixes #2980, fixes #3179, fixes #3920, fixes #3928, fixes #4444, fixes #4467, fixes #4476, fixes #4572, fixes #4614, fixes #4759, fixes #5427, fixes #6107, fixes #6221, fixes #6351, fixes #6371, fixes #7051, fixes #7120, fixes #7283, fixes #7367, fixes #7379, fixes #7457, fixes #7602, fixes #7635, fixes #7673, fixes #7753, fixes #7759, fixes #7815

Already fixed on main (but we added tests)

Ignored by this PR

Summary by CodeRabbit

  • New Features
    • Added selective SSR, client-only route, hydration, and pending-state coverage.
    • Improved route preloading, navigation transitions, redirects, caching, and hot updates.
  • Bug Fixes
    • Fixed pending UI timing, loader retries, abort handling, stale data, and error recovery.
    • Corrected SSR response statuses and rendering behavior.
  • Tests
    • Expanded React, Solid, Vue, SSR, hydration, preload, HMR, and navigation regression coverage.
  • Documentation
    • Clarified preload behavior, cache lifetimes, router state, and match semantics.
    1. Sheraff(GitHub profile, opens in a new tab) changed the title

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: react-router

    3. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-core

    4. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-plugin

    5. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: solid-router

    6. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-devtools-core

    7. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-server-core

    8. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: vue-router

    9. nx-cloud[bot](GitHub profile, opens in a new tab)commented

      View your CI Pipeline Execution ↗ for commit 27d10cb584ef74dc46e70e01713806b2c0dc7802

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded9m 46sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded2mView ↗

      ☁️ Nx Cloud last updated this comment at 2026-08-04 11:45:02 UTC

    10. github-actions[bot](GitHub profile, opens in a new tab)commented

      🚀 Changeset Version Preview

      4 package(s) bumped directly, 19 bumped as dependents.

      🟩 Patch bumps

      PackageVersionReason
      @tanstack/react-router1.170.18 → 1.170.19Changeset
      @tanstack/router-core1.171.15 → 1.171.16Changeset
      @tanstack/solid-router1.170.18 → 1.170.19Changeset
      @tanstack/vue-router1.170.17 → 1.170.18Changeset
      @tanstack/react-start1.168.35 → 1.168.36Dependent
      @tanstack/react-start-client1.168.16 → 1.168.17Dependent
      @tanstack/react-start-rsc0.1.34 → 0.1.35Dependent
      @tanstack/react-start-server1.167.23 → 1.167.24Dependent
      @tanstack/router-cli1.167.21 → 1.167.22Dependent
      @tanstack/router-generator1.167.21 → 1.167.22Dependent
      @tanstack/router-plugin1.168.23 → 1.168.24Dependent
      @tanstack/router-vite-plugin1.167.23 → 1.167.24Dependent
      @tanstack/solid-start1.168.34 → 1.168.35Dependent
      @tanstack/solid-start-client1.168.16 → 1.168.17Dependent
      @tanstack/solid-start-server1.167.23 → 1.167.24Dependent
      @tanstack/start-client-core1.170.14 → 1.170.15Dependent
      @tanstack/start-plugin-core1.171.26 → 1.171.27Dependent
      @tanstack/start-server-core1.169.18 → 1.169.19Dependent
      @tanstack/start-static-server-functions1.167.19 → 1.167.20Dependent
      @tanstack/start-storage-context1.167.17 → 1.167.18Dependent
      @tanstack/vue-start1.168.33 → 1.168.34Dependent
      @tanstack/vue-start-client1.167.19 → 1.167.20Dependent
      @tanstack/vue-start-server1.167.23 → 1.167.24Dependent
    11. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Review Change Stack

      Note

      Reviews paused

      It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

      Use the following commands to manage reviews:

      • @coderabbitai resume to resume automatic reviews.
      • @coderabbitai review to trigger a single review.

      Use the checkboxes below for quick actions:

      • ▶️ Resume reviews
      • 🔍 Trigger review
      📝 Walkthrough

      Walkthrough

      The PR rewrites router loading around client/server lanes, simplifies match stores, updates React/Solid/Vue rendering and SSR integration, changes HMR refresh behavior, adds extensive lifecycle and hydration tests, and updates loading documentation and end-to-end fixtures.

      Changes

      Router loading pipeline

      Layer / File(s)Summary
      Client/server lane orchestration
      packages/router-core/src/load-client.ts, packages/router-core/src/load-server.ts, packages/router-core/src/router.ts
      Client and server navigation use lane-based contextualization, loading, failure reduction, asset projection, caching, cancellation, and commit flows.
      Match and store contracts
      packages/router-core/src/Matches.ts, packages/router-core/src/stores.ts, packages/router-core/src/route.ts, packages/router-core/src/redirect.ts
      Pending, redirect, lazy-loading, and internal match state shapes are simplified and aligned with semantic match reuse.
      Adapter rendering and transitions
      packages/react-router/src/*, packages/solid-router/src/*, packages/vue-router/src/*
      Pending rendering, reset keys, transition acknowledgement, not-found propagation, hydration behavior, and SSR response statuses are updated across adapters.
      Regression coverage
      packages/router-core/tests/*, packages/react-router/tests/*, packages/solid-router/tests/*, packages/vue-router/tests/*, packages/start-server-core/tests/*
      Tests cover hydration, preload adoption, abort ownership, pending generations, redirects, lazy chunks, server failures, request cancellation, and lifecycle events.
      HMR refresh flow
      packages/router-plugin/src/core/hmr/handle-route-update.ts, packages/router-plugin/tests/*
      HMR updates rebuild route trees, clear lazy state and path caches, synchronize route exports, and invoke targeted route refreshes.
      Documentation and end-to-end fixtures
      docs/router/*, e2e/*, benchmarks/memory/*, .changeset/lane-match-loader-rewrite.md
      Public loading semantics, cache timing, match state, SSR behavior, issue reproductions, and benchmark cancellation handling are updated.

      Estimated code review effort: 5 (Critical) | ~120 minutes

      Possibly related issues

      • #2980 — Preload and cache-generation handling covers reuse of active ancestor data across repeated preloads.
      • #3179 — Preload and semantic match handling covers cause and beforeLoad behavior across cached and active matches.
      • #3928 — Loader flight cancellation and abort-aware result handling are directly covered by the client lane pipeline and regression tests.
      • #4614 — Selective SSR preload context behavior is covered by the cached-parent end-to-end test.
      • #7283 — Solid selective SSR hydration for ssr: false and ssr: 'data-only' pending routes is covered by the DEV-mode end-to-end suite.
      • #7379 — Direct-load head({ matches }) context and loader data population are covered by router-core tests.
      • #7457 — Initial redirects after asynchronous beforeLoad are covered by a React end-to-end reproduction.
      • #7910 — Pending-match loadPromise synchronization removal directly relates to the retrieved stale pending snapshot regression.

      Possibly related PRs

      • TanStack/router#6201 — Shares updates to Transitioner.tsx and URL/publicHref redirect handling.
      • TanStack/router#6704 — Continues the same router reactivity/store refactor across match, transition, and router-core loading APIs.
      • TanStack/router#7152 — Refactors the same router store APIs and consuming components/functions.

      Suggested labels: package: react-start, package: solid-start

      Suggested reviewers: schiller-manuel

      🚥 Pre-merge checks | ✅ 2 | ❌ 3

      ❌ Failed checks (3 warnings)

      Check nameStatusExplanationResolution
      Linked Issues check⚠️ WarningThe implementation covers most linked loader, pending, SSR, hydration, redirect, preload, and lifecycle issues, but no change addresses the #7815 scroll-restoration requirements.Implement or explicitly exclude the #7815 requirements, including pre-paint PUSH reset and native history restoration behavior.
      Out of Scope Changes check⚠️ WarningThe changes include unrelated public tuple-label edits and router-devtools package script changes that are not tied to the linked lane-loader objectives.Remove the unrelated tuple-label and devtools script changes, or split them into separate pull requests with matching objectives.
      Docstring Coverage⚠️ WarningDocstring coverage is 11.18% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (2 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title check✅ PassedThe title clearly identifies the primary change: a router-core lane match loader rewrite.
      ✨ Finishing Touches 💡 1
      📝 Generate docstrings 💡
      • Create stacked PR
      • Commit on current branch
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `fix-router-core-lane-match-loader`

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    12. github-actions[bot](GitHub profile, opens in a new tab)commented

      Bundle Size Benchmarks

      • Commit: 8431fac75823
      • Measured at: 2026-08-04T11:36:39.350Z
      • Baseline source: history:65ae78cf0625
      • Dashboard: bundle-size history

      The following scenarios have bundle-size changes compared with the baseline:

      ScenarioCurrent (gzip)Delta vs baselineInitial gzipRawBrotliTrend
      react-router.minimal87.11 KiB-246 B (-0.28%)86.97 KiB269.28 KiB75.85 KiB███████████▁
      react-router.full90.92 KiB-151 B (-0.16%)90.78 KiB281.29 KiB79.07 KiB███████████▁
      solid-router.minimal34.85 KiB-688 B (-1.89%)34.73 KiB100.14 KiB31.46 KiB███████████▁
      solid-router.full39.95 KiB-647 B (-1.56%)39.83 KiB115.37 KiB35.96 KiB███████████▁
      vue-router.minimal52.14 KiB-875 B (-1.61%)52.02 KiB143.30 KiB46.86 KiB███████████▁
      vue-router.full58.10 KiB-860 B (-1.42%)57.97 KiB162.07 KiB52.15 KiB███████████▁
      react-start.minimal102.00 KiB+18 B (+0.02%)101.87 KiB318.27 KiB88.50 KiB▁▁▁▁▁▁▁▁▁▁▁█
      react-start.deferred-hydration102.74 KiB+15 B (+0.01%)101.89 KiB319.64 KiB89.25 KiB▁▁▁▁▁▁▁▁▁▁▁█
      react-start.full105.41 KiB+45 B (+0.04%)105.27 KiB328.27 KiB91.38 KiB▁▁▁▁▁▁▁▁▁▁▁█
      react-start.rsbuild.minimal99.79 KiB+96 B (+0.09%)99.62 KiB312.70 KiB86.01 KiB▁▁▁▂▂▂▂▂▂▂▂█
      react-start.rsbuild.minimal-iife100.19 KiB+97 B (+0.09%)100.02 KiB313.64 KiB86.37 KiB▁▁▁▂▂▂▂▂▂▂▂█
      react-start.rsbuild.full103.12 KiB+221 B (+0.21%)102.95 KiB322.85 KiB88.78 KiB▁▁▁▁▁▁▁▁▁▁▁█
      solid-start.minimal49.67 KiB+60 B (+0.12%)49.54 KiB148.01 KiB44.14 KiB▁▁▁▁▁▁▁▁▁▁▁█
      solid-start.deferred-hydration52.93 KiB+64 B (+0.12%)49.60 KiB156.05 KiB47.21 KiB▁▁▁▁▁▁▁▁▁▁▁█
      solid-start.full54.95 KiB-480 B (-0.85%)54.82 KiB163.80 KiB48.64 KiB███████████▁
      vue-start.minimal70.46 KiB-583 B (-0.80%)70.33 KiB201.06 KiB62.61 KiB███████████▁
      vue-start.full74.42 KiB-624 B (-0.81%)74.29 KiB213.66 KiB65.95 KiB███████████▁

      Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.

    13. pkg-pr-new[bot](GitHub profile, opens in a new tab)commented
      More templates

      @tanstack/arktype-adapter

      npm i https://pkg.pr.new/@tanstack/arktype-adapter@7805

      @tanstack/eslint-plugin-router

      npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7805

      @tanstack/eslint-plugin-start

      npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7805

      @tanstack/history

      npm i https://pkg.pr.new/@tanstack/history@7805

      @tanstack/nitro-v2-vite-plugin

      npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7805

      @tanstack/react-router

      npm i https://pkg.pr.new/@tanstack/react-router@7805

      @tanstack/react-router-devtools

      npm i https://pkg.pr.new/@tanstack/react-router-devtools@7805

      @tanstack/react-router-ssr-query

      npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7805

      @tanstack/react-start

      npm i https://pkg.pr.new/@tanstack/react-start@7805

      @tanstack/react-start-client

      npm i https://pkg.pr.new/@tanstack/react-start-client@7805

      @tanstack/react-start-rsc

      npm i https://pkg.pr.new/@tanstack/react-start-rsc@7805

      @tanstack/react-start-server

      npm i https://pkg.pr.new/@tanstack/react-start-server@7805

      @tanstack/router-cli

      npm i https://pkg.pr.new/@tanstack/router-cli@7805

      @tanstack/router-core

      npm i https://pkg.pr.new/@tanstack/router-core@7805

      @tanstack/router-devtools

      npm i https://pkg.pr.new/@tanstack/router-devtools@7805

      @tanstack/router-devtools-core

      npm i https://pkg.pr.new/@tanstack/router-devtools-core@7805

      @tanstack/router-generator

      npm i https://pkg.pr.new/@tanstack/router-generator@7805

      @tanstack/router-plugin

      npm i https://pkg.pr.new/@tanstack/router-plugin@7805

      @tanstack/router-ssr-query-core

      npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7805

      @tanstack/router-utils

      npm i https://pkg.pr.new/@tanstack/router-utils@7805

      @tanstack/router-vite-plugin

      npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7805

      @tanstack/solid-router

      npm i https://pkg.pr.new/@tanstack/solid-router@7805

      @tanstack/solid-router-devtools

      npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7805

      @tanstack/solid-router-ssr-query

      npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7805

      @tanstack/solid-start

      npm i https://pkg.pr.new/@tanstack/solid-start@7805

      @tanstack/solid-start-client

      npm i https://pkg.pr.new/@tanstack/solid-start-client@7805

      @tanstack/solid-start-server

      npm i https://pkg.pr.new/@tanstack/solid-start-server@7805

      @tanstack/start-client-core

      npm i https://pkg.pr.new/@tanstack/start-client-core@7805

      @tanstack/start-fn-stubs

      npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7805

      @tanstack/start-plugin-core

      npm i https://pkg.pr.new/@tanstack/start-plugin-core@7805

      @tanstack/start-server-core

      npm i https://pkg.pr.new/@tanstack/start-server-core@7805

      @tanstack/start-static-server-functions

      npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7805

      @tanstack/start-storage-context

      npm i https://pkg.pr.new/@tanstack/start-storage-context@7805

      @tanstack/valibot-adapter

      npm i https://pkg.pr.new/@tanstack/valibot-adapter@7805

      @tanstack/virtual-file-routes

      npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7805

      @tanstack/vue-router

      npm i https://pkg.pr.new/@tanstack/vue-router@7805

      @tanstack/vue-router-devtools

      npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7805

      @tanstack/vue-router-ssr-query

      npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7805

      @tanstack/vue-start

      npm i https://pkg.pr.new/@tanstack/vue-start@7805

      @tanstack/vue-start-client

      npm i https://pkg.pr.new/@tanstack/vue-start-client@7805

      @tanstack/vue-start-server

      npm i https://pkg.pr.new/@tanstack/vue-start-server@7805

      @tanstack/zod-adapter

      npm i https://pkg.pr.new/@tanstack/zod-adapter@7805

      commit: 27d10cb

    14. codspeed[bot](GitHub profile, opens in a new tab)commented

      Merging this PR will regress 0 benchmarks

      :warning: Different runtime environments detected

      Some benchmarks with significant performance changes were compared across different runtime environments, which may affect the accuracy of the results.

      Open the report in CodSpeed to investigate

      ⚡ 101 improved benchmarks ❌ 26 (👁 26) regressed benchmarks ✅ 53 untouched benchmarks

      Performance Changes

      ModeBenchmarkBASEHEADEfficiency
      ⚡Memorymem client interrupted-navigations (react)755.7 KB251.6 KB×3
      ⚡Memorymem client interrupted-navigations (solid)841.2 KB341 KB×2.5
      ⚡Simulationssr redirect (solid)59.5 ms36.8 ms+61.7%
      ⚡Simulationssr redirect (react)61.3 ms38.3 ms+60.03%
      ⚡Simulationssr redirect (vue)68.3 ms49.8 ms+37.2%
      ⚡Simulationclient-mount loop (solid)58.5 ms42.7 ms+37.05%
      ⚡Simulationclient-history navigation loop (solid)69.2 ms52.3 ms+32.22%
      ⚡Simulationclient-rewrites navigation loop (react)64.2 ms48.7 ms+31.93%
      ⚡Simulationclient-rewrites navigation loop (solid)110.9 ms84.3 ms+31.59%
      ⚡Simulationclient-async-pipeline navigation loop (solid)84.6 ms64.4 ms+31.29%
      ⚡Simulationclient-route-tree-scale navigation loop (solid)169.9 ms131 ms+29.76%
      ⚡Memorymem client loader-data-retention (react)203.5 KB157.1 KB+29.59%
      ⚡Simulationclient-side navigation loop (solid)111.8 ms87.9 ms+27.26%
      ⚡Memorymem server error-paths not-found (vue)414.8 KB331 KB+25.3%
      ⚡Simulationclient-control-flow navigation loop (solid)81.9 ms65.8 ms+24.5%
      ⚡Simulationclient-links navigation loop (solid)486.8 ms396.7 ms+22.7%
      ⚡Simulationssr control-flow route headers (vue)213.4 ms176.4 ms+20.97%
      ⚡Simulationssr before-load chain (vue)184.6 ms153.4 ms+20.35%
      ⚡Simulationssr not-found (react)59.2 ms49.3 ms+20.15%
      ⚡Simulationssr global-mw document (vue)220.9 ms186 ms+18.79%
      ..................

      :information_source: Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

      [!TIP] Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


      Comparing fix-router-core-lane-match-loader (27d10cb) with main (65ae78c) Open in CodSpeed
    15. Actionable comments posted: 6

      Caution

      Some comments are outside the diff and can’t be posted inline due to platform limitations.

      ⚠️ Outside diff range comments (1)
      packages/vue-router/src/useMatch.tsx (1)

      137-154: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

      Preserve the generic result type instead of erasing it with any.

      Vue.computed<any> allows the implementation to violate the declared ThrowOrOptional<UseMatchResult<...>> contract without a compiler error. Type match and result from the existing generic aliases.

      As per coding guidelines, “Use TypeScript strict mode with extensive type safety.”

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/vue-router/src/useMatch.tsx` around lines 137 - 154, Update the
      computed result in the useMatch flow to preserve the existing generic result
      type instead of using Vue.computed<any>. Type match and result with the existing
      generic aliases, including the declared ThrowOrOptional<UseMatchResult<...>>
      contract, so incorrect return values are caught by TypeScript while preserving
      the current selection and missing-match behavior.

      Source: Coding guidelines

      🧹 Nitpick comments (7)
      e2e/solid-start/selective-ssr/tests/issue-7283-dev-hydration.spec.ts (1)

      27-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

      Use braces for all conditional bodies.

      These one-line if statements violate the repository’s TypeScript control-flow convention.

      As per coding guidelines, **/*.{ts,tsx,js,jsx} must use curly braces for control statements.

      Also applies to: 79-79, 84-84

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@e2e/solid-start/selective-ssr/tests/issue-7283-dev-hydration.spec.ts` at line
      27, Update the one-line conditional statements in
      issue-7283-dev-hydration.spec.ts, including the checks around lines 27, 79, and
      84, to wrap each conditional body in curly braces while preserving their
      existing behavior.

      Source: Coding guidelines

      packages/solid-router/tests/transitioner-remount.test.tsx (1)

      54-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

      Avoid discarding location-state type safety.

      Assert the partial state shape directly instead of casting to any.

      Proposed change
      -    expect((router.state.location.state as any).remounted).toBe(true)
      +    expect(router.state.location.state).toMatchObject({ remounted: true })

      As per coding guidelines, TypeScript files must use strict mode with extensive type safety.

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/solid-router/tests/transitioner-remount.test.tsx` at line 54,
      Replace the any cast in the remounted-state assertion with a type-safe assertion
      of the partial location-state shape, using an appropriate typed access or
      narrowing approach so router.state.location.state remains checked by TypeScript.

      Source: Coding guidelines

      packages/router-core/tests/fatal-load-rejection.test.ts (1)

      25-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

      Model the error component without bypassing its route contract.

      as any prevents this test from detecting changes to the errorComponent interface. Use a callable mock component with its preload property attached, matching the runtime shape used elsewhere.

      Proposed fix
      +    const ErrorComponent = Object.assign(() => null, {
      +      preload: errorComponentPreload,
      +    })
      +
           const rootRoute = new BaseRootRoute({
             loader: () => 'root data',
      -      errorComponent: { preload: errorComponentPreload } as any,
      +      errorComponent: ErrorComponent,
           })

      As per coding guidelines, TypeScript files must use strict mode with extensive type safety.

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/router-core/tests/fatal-load-rejection.test.ts` around lines 25 -
      30, Update the errorComponent setup in the BaseRootRoute test to use a typed
      callable mock component with its preload property attached, matching the runtime
      component shape. Remove the as any cast so TypeScript validates the
      errorComponent contract and the test catches interface changes.

      Source: Coding guidelines

      packages/router-core/tests/issue-6371-search-default-normalization-abort.test.ts (1)

      60-75: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

      Keep the canonical replacement setup type-checked.

      Both as any casts allow this regression test to keep compiling if buildLocation or commitLocation changes incompatibly. Please use their declared/internal option types or a typed helper for the Transitioner operation being reproduced.

      As per coding guidelines, TypeScript files must use strict mode with extensive type safety.

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In
      `@packages/router-core/tests/issue-6371-search-default-normalization-abort.test.ts`
      around lines 60 - 75, Remove the as any casts from the buildLocation and
      commitLocation calls in this regression test. Use the declared option types or a
      typed helper representing the Transitioner operation so both canonical
      replacement setup calls remain strictly type-checked while preserving their
      existing behavior.

      Source: Coding guidelines

      packages/router-core/tests/issue-4444-param-parse-error-lazy-child.test.ts (1)

      19-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

      Assert that the lazy child chunk was never requested.

      The test can currently pass even if lazyFn runs before the child is trimmed, leaving the documented regression partially uncovered.

      Proposed assertion
       expect(
         router.state.matches.find((match) => match.status === 'pending'),
       ).toBeUndefined()
      +expect(lazyFn).not.toHaveBeenCalled()
       expect(router.state.isLoading).toBe(false)

      Also applies to: 60-68

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/router-core/tests/issue-4444-param-parse-error-lazy-child.test.ts`
      around lines 19 - 21, Update the test using the lazyFn mock so it explicitly
      asserts lazyFn was never called when the child route is trimmed after the
      parameter parse error. Place the assertion after the relevant navigation or
      error-handling flow, preserving the existing test behavior while verifying the
      lazy child chunk is not requested.
      packages/react-router/tests/transactional-loading.test.tsx (1)

      130-148: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

      Capture every committed pair to verify atomic publication.

      The final sequential assertions can miss a transient mixed-generation render after childRefresh resolves. Record parent/child values on each committed render and assert that neither parent-v2/child-v1 nor parent-v1/child-v2 occurs.

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/react-router/tests/transactional-loading.test.tsx` around lines 130
      - 148, Update the transactional loading test around the final refresh sequence
      to record the parent and child values on every committed render, then assert no
      mixed-generation pair occurs: parent-v2 with child-v1 or parent-v1 with
      child-v2. Keep the existing final-state assertions and use the
      render-observation mechanism already provided by the test setup.
      packages/router-core/src/router.ts (1)

      1330-1338: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

      Silent catch {} hides listener failures.

      Swallowing all listener exceptions keeps one bad listener from breaking others, but the fully empty catch also hides real bugs during development. Consider logging in non-production.

      ♻️ Suggested dev logging
             if (listener.eventType === routerEvent.type) {
               try {
                 listener.fn(routerEvent)
      -        } catch {}
      +        } catch (err) {
      +          if (process.env.NODE_ENV !== 'production') {
      +            console.error(
      +              `Error in router event listener for "${routerEvent.type}":`,
      +              err,
      +            )
      +          }
      +        }
             }

      If tests assert fully-silent behavior, feel free to disregard.

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/router-core/src/router.ts` around lines 1330 - 1338, Update the
      catch block in the emit method to retain listener isolation while reporting
      listener exceptions in non-production environments. Preserve the existing
      behavior of continuing to notify other subscribers and keeping production
      logging silent.
      🤖 Prompt for all review comments with AI agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      Inline comments:
      In `@e2e/solid-start/selective-ssr/src/routes/ssr-false-pending-min.tsx`:
      - Around line 6-13: Update recordEvent to avoid casting window to any by
      declaring a local Window augmentation for the __events event buffer, then
      initialize and append through window.__events. Preserve the existing server
      guard and event shape, including the performance timestamp.
      
      In `@packages/react-router/tests/router.test.tsx`:
      - Around line 2463-2467: Update the navigation assertion in the router test to
      target the parent route’s specific not-found boundary, using its unique test
      identifier or boundary-specific text instead of the broad “Not Found” match;
      keep the existing home-page and navigation steps unchanged.
      
      In `@packages/router-core/tests/issue-6221-head-waits-for-loader.test.ts`:
      - Line 23: Update the authentication check in the relevant test to wrap the
      notFound call inside curly braces, preserving the existing condition and
      behavior.
      
      In `@packages/solid-router/src/Transitioner.tsx`:
      - Around line 47-65: Move the Solid.onCleanup registration for unsub immediately
      after router.history.subscribe(router.load), before the early return in the
      Transitioner setup. Keep the existing cleanup callback unchanged and remove the
      later registration so every execution path disposes the history subscription.
      
      In `@packages/solid-router/tests/on-rendered-change-info.test.tsx`:
      - Around line 44-61: Update the onRendered transition handling to call
      getLocationChangeInfo with the previously rendered location as the first
      argument and the latest resolved location as the second. Ensure fromLocation,
      toLocation, and change flags reflect the actual transition, including same-href
      state changes; locate the change in the code that constructs the onRendered
      event.
      
      In `@packages/vue-router/tests/pending-fallback-promise-replacement.test.tsx`:
      - Around line 13-18: Update the afterEach cleanup hook to drain and await all
      testCleanups while fake timers remain active, then restore real timers in a
      finally block so timer state is reset even if cleanup fails. Preserve the
      existing cleanup() call after the callbacks settle.
      
      ---
      
      Outside diff comments:
      In `@packages/vue-router/src/useMatch.tsx`:
      - Around line 137-154: Update the computed result in the useMatch flow to
      preserve the existing generic result type instead of using Vue.computed<any>.
      Type match and result with the existing generic aliases, including the declared
      ThrowOrOptional<UseMatchResult<...>> contract, so incorrect return values are
      caught by TypeScript while preserving the current selection and missing-match
      behavior.
      
      ---
      
      Nitpick comments:
      In `@e2e/solid-start/selective-ssr/tests/issue-7283-dev-hydration.spec.ts`:
      - Line 27: Update the one-line conditional statements in
      issue-7283-dev-hydration.spec.ts, including the checks around lines 27, 79, and
      84, to wrap each conditional body in curly braces while preserving their
      existing behavior.
      
      In `@packages/react-router/tests/transactional-loading.test.tsx`:
      - Around line 130-148: Update the transactional loading test around the final
      refresh sequence to record the parent and child values on every committed
      render, then assert no mixed-generation pair occurs: parent-v2 with child-v1 or
      parent-v1 with child-v2. Keep the existing final-state assertions and use the
      render-observation mechanism already provided by the test setup.
      
      In `@packages/router-core/src/router.ts`:
      - Around line 1330-1338: Update the catch block in the emit method to retain
      listener isolation while reporting listener exceptions in non-production
      environments. Preserve the existing behavior of continuing to notify other
      subscribers and keeping production logging silent.
      
      In `@packages/router-core/tests/fatal-load-rejection.test.ts`:
      - Around line 25-30: Update the errorComponent setup in the BaseRootRoute test
      to use a typed callable mock component with its preload property attached,
      matching the runtime component shape. Remove the as any cast so TypeScript
      validates the errorComponent contract and the test catches interface changes.
      
      In `@packages/router-core/tests/issue-4444-param-parse-error-lazy-child.test.ts`:
      - Around line 19-21: Update the test using the lazyFn mock so it explicitly
      asserts lazyFn was never called when the child route is trimmed after the
      parameter parse error. Place the assertion after the relevant navigation or
      error-handling flow, preserving the existing test behavior while verifying the
      lazy child chunk is not requested.
      
      In
      `@packages/router-core/tests/issue-6371-search-default-normalization-abort.test.ts`:
      - Around line 60-75: Remove the as any casts from the buildLocation and
      commitLocation calls in this regression test. Use the declared option types or a
      typed helper representing the Transitioner operation so both canonical
      replacement setup calls remain strictly type-checked while preserving their
      existing behavior.
      
      In `@packages/solid-router/tests/transitioner-remount.test.tsx`:
      - Line 54: Replace the any cast in the remounted-state assertion with a
      type-safe assertion of the partial location-state shape, using an appropriate
      typed access or narrowing approach so router.state.location.state remains
      checked by TypeScript.
      🪄 Autofix (Beta)

      Fix all unresolved CodeRabbit comments on this PR:

      • Push a commit to this branch (recommended)
      • Create a new PR with the fixes

      ℹ️ Review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: a9eff563-1e9d-4b5e-9e0d-17c99dcf056c

      📥 Commits

      Reviewing files that changed from the base of the PR and between 41f7bf32837e751b2874e7d827f7456f8a5bd716 and ceaa4d26f29671842f548ead4a7d91715736bd6b.

      📒 Files selected for processing (162)
      • benchmarks/memory/client/scenarios/interrupted-navigations/shared.ts
      • e2e/solid-start/selective-ssr/src/routeTree.gen.ts
      • e2e/solid-start/selective-ssr/src/routes/ssr-false-pending-min.tsx
      • e2e/solid-start/selective-ssr/tests/issue-7283-dev-hydration.spec.ts
      • packages/react-router/src/Match.tsx
      • packages/react-router/src/Matches.tsx
      • packages/react-router/src/Transitioner.tsx
      • packages/react-router/src/lazyRouteComponent.tsx
      • packages/react-router/src/ssr/renderRouterToStream.tsx
      • packages/react-router/src/ssr/renderRouterToString.tsx
      • packages/react-router/tests/Matches.test.tsx
      • packages/react-router/tests/ancestor-loader-child-pending-min.test.tsx
      • packages/react-router/tests/component-preload-retry-pending-min.test.tsx
      • packages/react-router/tests/component-preload-retry.test.tsx
      • packages/react-router/tests/errorComponent.test.tsx
      • packages/react-router/tests/hydration-capped-boundary-pending.test.tsx
      • packages/react-router/tests/hydration-terminal-lane.test.tsx
      • packages/react-router/tests/issue-4759-pending-frame.test.tsx
      • packages/react-router/tests/issue-7051-force-pending-suspense.test.tsx
      • packages/react-router/tests/issue-7367-pending-min-redirect.test.tsx
      • packages/react-router/tests/issue-7457-redirect-chain-first-load.test.tsx
      • packages/react-router/tests/issue-7638-invalidate-transition-error.test.tsx
      • packages/react-router/tests/loaders.test.tsx
      • packages/react-router/tests/on-rendered-same-href-state.test.tsx
      • packages/react-router/tests/pending-fallback-promise-replacement.test.tsx
      • packages/react-router/tests/preloaded-mount-resolution.test.tsx
      • packages/react-router/tests/redirect.test.tsx
      • packages/react-router/tests/root-pending-min.test.tsx
      • packages/react-router/tests/router.test.tsx
      • packages/react-router/tests/store-updates-during-navigation.test.tsx
      • packages/react-router/tests/transactional-loading.test.tsx
      • packages/react-router/tests/transitioner-listener-errors.test.tsx
      • packages/react-router/tests/transitioner-render-ack.test.tsx
      • packages/react-router/tests/transitioner-router-swap.test.tsx
      • packages/react-router/tests/useNavigate.test.tsx
      • packages/router-core/src/Matches.ts
      • packages/router-core/src/hydrate.ts
      • packages/router-core/src/isServer/client.ts
      • packages/router-core/src/isServer/development.ts
      • packages/router-core/src/isServer/server.ts
      • packages/router-core/src/load-matches.ts
      • packages/router-core/src/load.client.ts
      • packages/router-core/src/load.server.ts
      • packages/router-core/src/redirect.ts
      • packages/router-core/src/route-chunks.ts
      • packages/router-core/src/route.ts
      • packages/router-core/src/router.ts
      • packages/router-core/src/ssr/createRequestHandler.ts
      • packages/router-core/src/ssr/ssr-client.ts
      • packages/router-core/src/ssr/ssr-server.ts
      • packages/router-core/src/stores.ts
      • packages/router-core/tests/background-assets-stale.test.ts
      • packages/router-core/tests/background-trim-abort.test.ts
      • packages/router-core/tests/blocked-navigation-current-load.test.ts
      • packages/router-core/tests/boundary-component-chunk.test.ts
      • packages/router-core/tests/callbacks.test.ts
      • packages/router-core/tests/chunk-failure-lifecycle.test.ts
      • packages/router-core/tests/client-lane-adversarial.test.ts
      • packages/router-core/tests/fatal-load-rejection.test.ts
      • packages/router-core/tests/granular-stores.test.ts
      • packages/router-core/tests/hydrate.test.ts
      • packages/router-core/tests/hydrated-stay-match-data.test.ts
      • packages/router-core/tests/hydration-asset-context-order.test.ts
      • packages/router-core/tests/hydration-boundary-chunks.test.ts
      • packages/router-core/tests/hydration-currentness.test.ts
      • packages/router-core/tests/invalidate-pre-rematch-failure.test.ts
      • packages/router-core/tests/issue-3928-rapid-reload-abort.test.ts
      • packages/router-core/tests/issue-4078-loader-notfound-root-boundary.test.ts
      • packages/router-core/tests/issue-4444-param-parse-error-lazy-child.test.ts
      • packages/router-core/tests/issue-4476-preload-navigate-abort.test.ts
      • packages/router-core/tests/issue-4572-preload-root-beforeload-flags.test.ts
      • packages/router-core/tests/issue-4684-head-on-beforeload-error.test.ts
      • packages/router-core/tests/issue-5106-hydrated-notfound-boundary.test.ts
      • packages/router-core/tests/issue-6107-preload-chunk-failure.test.ts
      • packages/router-core/tests/issue-6221-head-waits-for-loader.test.ts
      • packages/router-core/tests/issue-6351-fuzzy-notfound-layout.test.ts
      • packages/router-core/tests/issue-6371-search-default-normalization-abort.test.ts
      • packages/router-core/tests/issue-7379-head-matches-direct-load.test.ts
      • packages/router-core/tests/issue-7635-dehydrated-error-child-head.test.ts
      • packages/router-core/tests/load-route-chunk.test.ts
      • packages/router-core/tests/load.test.ts
      • packages/router-core/tests/preflight-reentrant-context.test.ts
      • packages/router-core/tests/preload-adoption.test.ts
      • packages/router-core/tests/preload-background-parent-coherence.test.ts
      • packages/router-core/tests/preload-public-cache-behavior.test.ts
      • packages/router-core/tests/preload-public-signal-lifetime.test.ts
      • packages/router-core/tests/routerTestUtils.ts
      • packages/router-core/tests/serial-failure-foreground-prefix.test.ts
      • packages/router-core/tests/server-async-headers-decorative-hang.test.ts
      • packages/router-core/tests/server-beforeload-preload-flag.test.ts
      • packages/router-core/tests/server-chunk-failure-lifecycle.test.ts
      • packages/router-core/tests/server-concurrent-error-notfound.test.ts
      • packages/router-core/tests/server-headers-asset-failure.test.ts
      • packages/router-core/tests/server-loader-abort-error.test.ts
      • packages/router-core/tests/server-serial-ssr-notfound.test.ts
      • packages/router-core/tests/server-ssr-false-assets.test.ts
      • packages/router-core/tests/server-ssr-option-error.test.ts
      • packages/router-core/tests/stay-match-abort.test.ts
      • packages/router-core/tests/superseded-load-await.test.ts
      • packages/router-devtools-core/src/AgeTicker.tsx
      • packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.tsx
      • packages/router-plugin/src/core/hmr/handle-route-update.ts
      • packages/router-plugin/tests/add-hmr.test.ts
      • packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@true.tsx
      • packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@webpack-hot.tsx
      • packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@true.tsx
      • packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@true.tsx
      • packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@true.tsx
      • packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx
      • packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@true.tsx
      • packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@true.tsx
      • packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@true.tsx
      • packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@true.tsx
      • packages/router-plugin/tests/handle-route-update.test.ts
      • packages/solid-router/src/ClientOnly.tsx
      • packages/solid-router/src/Match.tsx
      • packages/solid-router/src/Matches.tsx
      • packages/solid-router/src/Transitioner.tsx
      • packages/solid-router/src/lazyRouteComponent.tsx
      • packages/solid-router/src/matchContext.tsx
      • packages/solid-router/src/routerStores.ts
      • packages/solid-router/src/ssr/renderRouterToStream.tsx
      • packages/solid-router/src/ssr/renderRouterToString.tsx
      • packages/solid-router/src/useMatch.tsx
      • packages/solid-router/tests/Transitioner.test.tsx
      • packages/solid-router/tests/component-preload-retry.test.tsx
      • packages/solid-router/tests/link.test.tsx
      • packages/solid-router/tests/loaders.test.tsx
      • packages/solid-router/tests/on-rendered-change-info.test.tsx
      • packages/solid-router/tests/pending-fallback-promise-replacement.test.tsx
      • packages/solid-router/tests/redirect.test.tsx
      • packages/solid-router/tests/router.test.tsx
      • packages/solid-router/tests/same-route-pending-blank.test.tsx
      • packages/solid-router/tests/server/errorComponent.test.tsx
      • packages/solid-router/tests/store-updates-during-navigation.test.tsx
      • packages/solid-router/tests/transitioner-listener-errors.test.tsx
      • packages/solid-router/tests/transitioner-remount.test.tsx
      • packages/solid-router/tests/transitioner-render-ack.test.tsx
      • packages/solid-router/tests/use-match-outgoing-transition.test.tsx
      • packages/start-server-core/src/createStartHandler.ts
      • packages/vue-router/src/Match.tsx
      • packages/vue-router/src/Matches.tsx
      • packages/vue-router/src/Transitioner.tsx
      • packages/vue-router/src/lazyRouteComponent.tsx
      • packages/vue-router/src/matchContext.tsx
      • packages/vue-router/src/routerStores.ts
      • packages/vue-router/src/ssr/renderRouterToStream.tsx
      • packages/vue-router/src/ssr/renderRouterToString.tsx
      • packages/vue-router/src/useMatch.tsx
      • packages/vue-router/tests/Matches.test.tsx
      • packages/vue-router/tests/Transitioner.test.tsx
      • packages/vue-router/tests/component-preload-retry.test.tsx
      • packages/vue-router/tests/hydration-capped-boundary-pending.test.tsx
      • packages/vue-router/tests/link.test.tsx
      • packages/vue-router/tests/loaders.test.tsx
      • packages/vue-router/tests/pending-fallback-promise-replacement.test.tsx
      • packages/vue-router/tests/redirect.test.tsx
      • packages/vue-router/tests/router.test.tsx
      • packages/vue-router/tests/store-updates-during-navigation.test.tsx
      • packages/vue-router/tests/transitioner-idle-after-render.test.tsx
      • packages/vue-router/tests/transitioner-listener-errors.test.tsx
      • packages/vue-router/tests/transitioner-remount-rendered.test.tsx
      💤 Files with no reviewable changes (13)
      • packages/router-plugin/tests/add-hmr.test.ts
      • packages/solid-router/src/matchContext.tsx
      • packages/router-core/src/load-matches.ts
      • packages/solid-router/tests/server/errorComponent.test.tsx
      • packages/solid-router/tests/Transitioner.test.tsx
      • packages/router-core/src/redirect.ts
      • packages/vue-router/src/routerStores.ts
      • packages/router-core/src/ssr/ssr-server.ts
      • packages/solid-router/src/routerStores.ts
      • packages/router-core/tests/callbacks.test.ts
      • packages/vue-router/tests/redirect.test.tsx
      • packages/solid-router/tests/redirect.test.tsx
      • benchmarks/memory/client/scenarios/interrupted-navigations/shared.ts
    16. github-actions[bot](GitHub profile, opens in a new tab) added labelsdocumentation

    17. Actionable comments posted: 1

      🧹 Nitpick comments (1)
      packages/router-core/tests/preload-beforeload-reuse.test.ts (1)

      222-280: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

      Add a same-route loaderDeps case. This test only changes the parent match; it doesn’t cover reusing preloaded child context when the route’s own deps change.

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/router-core/tests/preload-beforeload-reuse.test.ts` around lines 222
      - 280, Extend the test around childBeforeLoad to add a same-route loaderDeps
      scenario where the child route’s own dependencies change between preload and
      navigation. Configure childRoute with loaderDeps and assert the preloaded child
      context is not reused, including updated context values and the expected preload
      flags.
      🤖 Prompt for all review comments with AI agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      Inline comments:
      In `@packages/router-core/tests/preload-beforeload-reuse.test.ts`:
      - Around line 242-245: Update the regression case around loaderDeps and context
      to preserve type checking for the version contract: add a typed validateSearch
      definition for version, replace Record<string, any> with the inferred or
      explicit validated search type, and remove the as any casts around preloadRoute,
      navigate, and beforeLoad replacement by using typed route refresh helpers or a
      type-compatible mock.
      
      ---
      
      Nitpick comments:
      In `@packages/router-core/tests/preload-beforeload-reuse.test.ts`:
      - Around line 222-280: Extend the test around childBeforeLoad to add a
      same-route loaderDeps scenario where the child route’s own dependencies change
      between preload and navigation. Configure childRoute with loaderDeps and assert
      the preloaded child context is not reused, including updated context values and
      the expected preload flags.
      🪄 Autofix (Beta)

      Fix all unresolved CodeRabbit comments on this PR:

      • Push a commit to this branch (recommended)
      • Create a new PR with the fixes

      ℹ️ Review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: beb16cf3-124d-4a1b-ae41-86535af7b3c1

      📥 Commits

      Reviewing files that changed from the base of the PR and between adf73dd544d5663f12c1ec1995bcae3f0545d059 and 6f75f500232a57810b29846e21dc7ebd03fa8bbe.

      📒 Files selected for processing (3)
      • docs/router/guide/preloading.md
      • packages/router-core/src/load-client.ts
      • packages/router-core/tests/preload-beforeload-reuse.test.ts
      🚧 Files skipped from review as they are similar to previous changes (1)
      • packages/router-core/src/load-client.ts
    18. Actionable comments posted: 1

      🤖 Prompt for all review comments with AI agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      Inline comments:
      In `@packages/router-core/tests/hydration-currentness.test.ts`:
      - Around line 205-232: Extract the repeated mockWindow.$_TSR scaffolding in the
      hydration currentness tests into a helper such as mockDehydratedRouter,
      accepting only the matches array and preserving the shared manifest,
      dehydratedData, callbacks, buffer, and initialized values. Replace the
      duplicated setups at the referenced test blocks with this helper while keeping
      each test’s matches payload unchanged.
      🪄 Autofix (Beta)

      Fix all unresolved CodeRabbit comments on this PR:

      • Push a commit to this branch (recommended)
      • Create a new PR with the fixes

      ℹ️ Review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: dae5e328-1744-4525-a06b-e2022da66f47

      📥 Commits

      Reviewing files that changed from the base of the PR and between 6f75f500232a57810b29846e21dc7ebd03fa8bbe and f4b893487ccbe027821dfc6fc74d91dd98a5402f.

      📒 Files selected for processing (10)
      • e2e/react-start/basic/src/routes/specialChars/search.tsx
      • e2e/react-start/basic/tests/special-characters.spec.ts
      • packages/react-router/src/Transitioner.tsx
      • packages/router-core/src/load-client.ts
      • packages/router-core/src/router.ts
      • packages/router-core/tests/hydrated-stay-match-data.test.ts
      • packages/router-core/tests/hydration-currentness.test.ts
      • packages/solid-router/src/Transitioner.tsx
      • packages/solid-router/tests/transitioner-render-ack.test.tsx
      • packages/vue-router/src/Transitioner.tsx
      🚧 Files skipped from review as they are similar to previous changes (7)
      • packages/solid-router/tests/transitioner-render-ack.test.tsx
      • packages/react-router/src/Transitioner.tsx
      • packages/router-core/tests/hydrated-stay-match-data.test.ts
      • packages/solid-router/src/Transitioner.tsx
      • packages/vue-router/src/Transitioner.tsx
      • packages/router-core/src/load-client.ts
      • packages/router-core/src/router.ts
    19. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud is proposing a fix for your failed CI:

      We suppress SearchParamError and PathParamError in preloadClientRoute's catch block to restore pre-PR behavior, where those errors propagated silently to the caller rather than being logged via console.error. The E2E tests were failing because the test fixture captures all browser console errors, and the new catch block was incorrectly logging expected search-param validation failures that occur during route preloading.

      Warning

      ❌ We could not verify this fix.

      Suggested Fix changes
      diff --git a/packages/router-core/src/load-client.ts b/packages/router-core/src/load-client.ts
      index 9f625b89..3bcf2c99 100644
      --- a/packages/router-core/src/load-client.ts
      +++ b/packages/router-core/src/load-client.ts
      @@ -3,7 +3,11 @@
       import { isNotFound } from './not-found'
       import { isRedirect } from './redirect'
       import { loadRouteChunk } from './route-chunks'
      -import { getLocationChangeInfo } from './router'
      +import {
      +  getLocationChangeInfo,
      +  PathParamError,
      +  SearchParamError,
      +} from './router'
       import type { ParsedLocation } from './location'
       import type { AnyRouteMatch } from './Matches'
       import type { NotFoundError } from './not-found'
      @@ -1556,7 +1560,11 @@ export async function preloadClientRoute(
               redirects + 1,
             )
           }
      -    if (!isNotFound(cause)) {
      +    if (
      +      !isNotFound(cause) &&
      +      !(cause instanceof SearchParamError) &&
      +      !(cause instanceof PathParamError)
      +    ) {
             console.error(cause)
           }
           if (matches!) {
      

      Apply fix via Nx Cloud  Reject fix via Nx Cloud


      Or Apply changes locally with:

      npx nx-cloud apply-locally 78p0-6CYN
      Apply fix locally with your editor ↗   View interactive diff ↗

      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    20. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud has identified a possible root cause for your failed CI:

      We determined that the tanstack-start-example-rscs:build failure is unrelated to this PR's changes — the project was not touched, and the error stems from a pre-existing version incompatibility between nitro-nightly and the installed nitro package, which does not export the ./runtime/meta subpath. Our recommendation is to update or align the nitro/nitro-nightly versions in the workspace to resolve this environment issue independently of this PR.

      No code changes were suggested for this issue.

      Trigger a rerun:

      Rerun CI

      Nx Cloud View detailed reasoning on Nx Cloud ↗


      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    21. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud has identified a possible root cause for your failed CI:

      We classified this build failure as an environment issue rather than a code regression. The error (ERR_PACKAGE_PATH_NOT_EXPORTED for nitro's ./runtime/meta subpath) originates in a third-party nightly dependency (nitro-nightly) and is unrelated to any source file changed in this PR. Our recommendation is to reconcile the installed versions of nitro and nitro-nightly in the workspace to resolve the incompatibility.

      No code changes were suggested for this issue.

      Trigger a rerun:

      Rerun CI

      Nx Cloud View detailed reasoning on Nx Cloud ↗


      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    22. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud has identified a possible root cause for your failed CI:

      This CI failure appears to be related to the environment or external dependencies rather than your code changes.

      No code changes were suggested for this issue.

      Trigger a rerun:

      Rerun CI

      Nx Cloud View detailed reasoning on Nx Cloud ↗


      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    23. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud has identified a possible root cause for your failed CI:

      We identified that this build failure is unrelated to the PR's changes. The tanstack-start-example-rscs example fails because nitro-nightly (a stale October 2025 nightly) attempts to import a ./runtime/meta subpath that is no longer exported by the installed nitro package. This is a pre-existing dependency version incompatibility that needs to be resolved by updating or pinning the nitro-nightly dependency.

      No code changes were suggested for this issue.

      Trigger a rerun:

      Rerun CI

      Nx Cloud View detailed reasoning on Nx Cloud ↗


      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    24. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud is proposing a fix for your failed CI:

      We corrected two symmetrical bugs in the AbortError handling introduced by the lane match loader rewrite. In load-server.ts the guard condition was inverted (using !signal.aborted), causing spontaneous loader AbortErrors to be silently swallowed as success instead of propagating as route failures; in load-client.ts the normalizeError fallback returned [success, undefined] for every non-router-aborted AbortError because startFlight had already handled the aborted case, making the success branch unreachable but harmful. Together these fixes ensure that only router-cancelled navigations discard AbortErrors as silent cancellations, while loader-own AbortErrors correctly surface as route errors.

      Warning

      ❌ We could not verify this fix.

      diff --git a/packages/router-core/src/load-client.ts b/packages/router-core/src/load-client.ts
      index 465aab62..03c464e8 100644
      --- a/packages/router-core/src/load-client.ts
      +++ b/packages/router-core/src/load-client.ts
      @@ -167,8 +167,8 @@ function normalizeError(
         cause: unknown,
         signal?: AbortSignal,
       ): LoaderOutcome {
      -  if (signal && (cause as any)?.name === 'AbortError') {
      -    return signal.aborted ? [canceled] : [success, undefined]
      +  if (signal?.aborted && (cause as any)?.name === 'AbortError') {
      +    return [canceled]
         }
         let outcome = normalize(cause, true, route.id)
         if (outcome[0] !== error) {
      diff --git a/packages/router-core/src/load-server.ts b/packages/router-core/src/load-server.ts
      index 341eef28..7327e9c2 100644
      --- a/packages/router-core/src/load-server.ts
      +++ b/packages/router-core/src/load-server.ts
      @@ -321,7 +321,7 @@ function startLoader(
           } else {
             const failed = (cause: unknown): LoadOutcome =>
               (cause as any)?.name === 'AbortError' &&
      -        !match.abortController.signal.aborted
      +        match.abortController.signal.aborted
                 ? [success, undefined]
                 : normalizeError(route, cause)
             let value: unknown
      

      Apply fix via Nx Cloud  Reject fix via Nx Cloud


      Or Apply changes locally with:

      npx nx-cloud apply-locally THxe-cCoh
      Apply fix locally with your editor ↗   View interactive diff ↗

      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    25. Important

      A [new CI pipeline execution](https://cloud.nx.app/cipes/6a57884846f3b4b5f2deedbf) was requested that may update the conclusion below...

      Nx Cloud has identified a possible root cause for your failed CI:

      We identified the failure in tanstack-react-start-e2e-basic:test:e2e--rsbuild-spa as an environment-level port conflict: both the dummy external server and the app server are configured to bind to port 43301, causing an EADDRINUSE error unrelated to our code changes. Our PR only modifies UI components and test assertions, with no changes to server or port configuration, so this failure cannot be attributed to this PR.

      No code changes were suggested for this issue.

      Trigger a rerun:

      Rerun CI

      Nx Cloud View detailed reasoning on Nx Cloud ↗


      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    26. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud is proposing a fix for your failed CI:

      We removed the = undefined initializer from declare isViewTransitionTypesSupported?: boolean in RouterCore, which caused TypeScript error TS1039 ("Initializers are not allowed in ambient contexts"). The declare modifier was introduced by the PR's byte-shaving commits to avoid unnecessary constructor overhead, but this one field was accidentally left with its initializer, breaking the build. Removing it aligns the field with its sibling declare shouldViewTransition and with TypeScript's rules for declare class members.

      Tip

      ✅ We verified this fix by re-running @tanstack/router-core:build.

      diff --git a/packages/router-core/src/router.ts b/packages/router-core/src/router.ts
      index c7e3b451..78527402 100644
      --- a/packages/router-core/src/router.ts
      +++ b/packages/router-core/src/router.ts
      @@ -1020,7 +1020,7 @@ export class RouterCore<
           reset?: boolean
         } = { next: true }
         declare shouldViewTransition?: boolean | ViewTransitionOptions
      -  declare isViewTransitionTypesSupported?: boolean = undefined
      +  declare isViewTransitionTypesSupported?: boolean
         subscribers = new Set<RouterListener<RouterEvent>>()
         declare _tx?: LoadTransaction
         declare _flights?: Map<string, LoaderFlight>
      

      Apply fix via Nx Cloud  Reject fix via Nx Cloud


      Or Apply changes locally with:

      npx nx-cloud apply-locally fwy8-KL1O
      Apply fix locally with your editor ↗   View interactive diff ↗

      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    27. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud is proposing a fix for your failed CI:

      We removed the declare keyword from class fields in router.ts to fix a Babel SyntaxError that occurred because @babel/plugin-transform-class-properties was running before @babel/plugin-transform-typescript could strip the ambient declarations. Converting declare field?: Type to field?: Type is semantically identical at runtime while being fully compatible with all Babel transform orderings.

      Tip

      ✅ We verified this fix by re-running tanstack-react-start-e2e-basic-scroll-restoration:test:e2e, tanstack-router-e2e-react-scroll-restoration-sandbox-vite:test:e2e, tanstack-react-start-e2e-dev-ssr-styles:test:e2e.

      Suggested Fix changes
      diff --git a/packages/router-core/src/router.ts b/packages/router-core/src/router.ts
      index 81012284..0631210a 100644
      --- a/packages/router-core/src/router.ts
      +++ b/packages/router-core/src/router.ts
      @@ -1014,23 +1014,23 @@ export class RouterCore<
           restoration?: boolean
           reset?: boolean
         } = { next: true }
      -  declare shouldViewTransition?: boolean | ViewTransitionOptions
      -  declare isViewTransitionTypesSupported?: boolean
      +  shouldViewTransition?: boolean | ViewTransitionOptions
      +  isViewTransitionTypesSupported?: boolean
         subscribers = new Set<RouterListener<RouterEvent>>()
         /** Current client load transaction and owner of navigation writes. */
      -  declare _tx?: LoadTransaction
      +  _tx?: LoadTransaction
         /** Shared in-flight route loaders keyed by match ID. */
      -  declare _flights?: Map<string, LoaderFlight>
      +  _flights?: Map<string, LoaderFlight>
         /** Last terminal matches, excluding temporary pending presentation. */
      -  declare _committedMatches?: Array<AnyRouteMatch>
      +  _committedMatches?: Array<AnyRouteMatch>
         /** Pending-boundary reveal and minimum-visible timing state. */
      -  declare _pending?: PendingSession
      +  _pending?: PendingSession
         /** Result of the latest server load, used to render or redirect. */
      -  declare _serverResult?: ServerLoadResult
      +  _serverResult?: ServerLoadResult
         /** Framework callback that acknowledges the current matches rendered. (used to polyfill when the framework's `startTransition` does not return an awaitable promise) */
      -  declare _rendered?: () => void
      +  _rendered?: () => void
         /** Development-only HMR reload for a route and its descendants. */
      -  declare _refreshRoute: ((routeId: string) => Promise<void>) | undefined
      +  _refreshRoute?: (routeId: string) => Promise<void>
       
         // Must build in constructor
         stores!: RouterStores<TRouteTree>
      

      Apply fix via Nx Cloud  Reject fix via Nx Cloud


      Or Apply changes locally with:

      npx nx-cloud apply-locally h6tT-ykGl
      Apply fix locally with your editor ↗   View interactive diff ↗

      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    28. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud is proposing a fix for your failed CI:

      We replaced all TypeScript declare class fields in RouterCore with explicit = undefined initializers to fix the Babel transformation error occurring in the E2E test environments. The declare modifier requires @babel/plugin-transform-typescript to run before @babel/plugin-transform-class-properties, but the workspace Babel config runs them in the opposite order, causing a hard SyntaxError that prevented all three E2E tasks from starting. This change is semantically equivalent at runtime while restoring compatibility with the existing Babel plugin ordering.

      Tip

      ✅ We verified this fix by re-running tanstack-react-start-e2e-basic-scroll-restoration:test:e2e, tanstack-router-e2e-react-scroll-restoration-sandbox-vite:test:e2e, tanstack-react-start-e2e-dev-ssr-styles:test:e2e.

      Suggested Fix changes
      diff --git a/packages/router-core/src/router.ts b/packages/router-core/src/router.ts
      index 81012284..4480ae93 100644
      --- a/packages/router-core/src/router.ts
      +++ b/packages/router-core/src/router.ts
      @@ -1014,23 +1014,23 @@ export class RouterCore<
           restoration?: boolean
           reset?: boolean
         } = { next: true }
      -  declare shouldViewTransition?: boolean | ViewTransitionOptions
      -  declare isViewTransitionTypesSupported?: boolean
      +  shouldViewTransition?: boolean | ViewTransitionOptions = undefined
      +  isViewTransitionTypesSupported?: boolean = undefined
         subscribers = new Set<RouterListener<RouterEvent>>()
         /** Current client load transaction and owner of navigation writes. */
      -  declare _tx?: LoadTransaction
      +  _tx?: LoadTransaction = undefined
         /** Shared in-flight route loaders keyed by match ID. */
      -  declare _flights?: Map<string, LoaderFlight>
      +  _flights?: Map<string, LoaderFlight> = undefined
         /** Last terminal matches, excluding temporary pending presentation. */
      -  declare _committedMatches?: Array<AnyRouteMatch>
      +  _committedMatches?: Array<AnyRouteMatch> = undefined
         /** Pending-boundary reveal and minimum-visible timing state. */
      -  declare _pending?: PendingSession
      +  _pending?: PendingSession = undefined
         /** Result of the latest server load, used to render or redirect. */
      -  declare _serverResult?: ServerLoadResult
      +  _serverResult?: ServerLoadResult = undefined
         /** Framework callback that acknowledges the current matches rendered. (used to polyfill when the framework's `startTransition` does not return an awaitable promise) */
      -  declare _rendered?: () => void
      +  _rendered?: () => void = undefined
         /** Development-only HMR reload for a route and its descendants. */
      -  declare _refreshRoute: ((routeId: string) => Promise<void>) | undefined
      +  _refreshRoute: ((routeId: string) => Promise<void>) | undefined = undefined
       
         // Must build in constructor
         stores!: RouterStores<TRouteTree>
      

      Apply fix via Nx Cloud  Reject fix via Nx Cloud


      Or Apply changes locally with:

      npx nx-cloud apply-locally bckt-yAnZ
      Apply fix locally with your editor ↗   View interactive diff ↗

      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    29. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud is proposing a fix for your failed CI:

      We removed the declare keyword from 9 class fields in router.ts to fix a Babel plugin ordering error that was crashing all three E2E test suites. The declare syntax requires @babel/plugin-transform-typescript to run before @babel/plugin-transform-class-properties, an ordering that Playwright's Babel transform pipeline does not guarantee. Reverting to standard optional class field declarations (prop?: type) resolves the SyntaxError without changing runtime behavior.

      Tip

      ✅ We verified this fix by re-running tanstack-react-start-e2e-basic-scroll-restoration:test:e2e, tanstack-router-e2e-react-scroll-restoration-sandbox-vite:test:e2e, tanstack-react-start-e2e-dev-ssr-styles:test:e2e.

      Suggested Fix changes
      diff --git a/packages/router-core/src/router.ts b/packages/router-core/src/router.ts
      index 81012284..ca0650eb 100644
      --- a/packages/router-core/src/router.ts
      +++ b/packages/router-core/src/router.ts
      @@ -1014,23 +1014,23 @@ export class RouterCore<
           restoration?: boolean
           reset?: boolean
         } = { next: true }
      -  declare shouldViewTransition?: boolean | ViewTransitionOptions
      -  declare isViewTransitionTypesSupported?: boolean
      +  shouldViewTransition?: boolean | ViewTransitionOptions
      +  isViewTransitionTypesSupported?: boolean
         subscribers = new Set<RouterListener<RouterEvent>>()
         /** Current client load transaction and owner of navigation writes. */
      -  declare _tx?: LoadTransaction
      +  _tx?: LoadTransaction
         /** Shared in-flight route loaders keyed by match ID. */
      -  declare _flights?: Map<string, LoaderFlight>
      +  _flights?: Map<string, LoaderFlight>
         /** Last terminal matches, excluding temporary pending presentation. */
      -  declare _committedMatches?: Array<AnyRouteMatch>
      +  _committedMatches?: Array<AnyRouteMatch>
         /** Pending-boundary reveal and minimum-visible timing state. */
      -  declare _pending?: PendingSession
      +  _pending?: PendingSession
         /** Result of the latest server load, used to render or redirect. */
      -  declare _serverResult?: ServerLoadResult
      +  _serverResult?: ServerLoadResult
         /** Framework callback that acknowledges the current matches rendered. (used to polyfill when the framework's `startTransition` does not return an awaitable promise) */
      -  declare _rendered?: () => void
      +  _rendered?: () => void
         /** Development-only HMR reload for a route and its descendants. */
      -  declare _refreshRoute: ((routeId: string) => Promise<void>) | undefined
      +  _refreshRoute: ((routeId: string) => Promise<void>) | undefined
       
         // Must build in constructor
         stores!: RouterStores<TRouteTree>
      

      Apply fix via Nx Cloud  Reject fix via Nx Cloud


      Or Apply changes locally with:

      npx nx-cloud apply-locally aGSy-kgb4
      Apply fix locally with your editor ↗   View interactive diff ↗

      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    30. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: react-start-client

    31. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: solid-start-client

    32. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-plugin-core

    33. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: start-client-core

    34. github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: vue-start-client

    35. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud is proposing a fix for your failed CI:

      We updated two stale HMR snapshots (createFileRoute-lowercase-components@true.tsx and createRootRoute-lowercase-components@true.tsx) and replaced the undefined getReferenceRouteCompilerPlugins reference in the test file with the already-imported getFrameworkHmrCompilerPlugins. These changes align the test fixtures with the simplified handleRouteUpdate implementation introduced by the lane match loader rewrite, resolving both the snapshot mismatches and the ReferenceError/TS2304 type error.

      Tip

      ✅ We verified this fix by re-running @tanstack/router-plugin:test:unit, @tanstack/router-plugin:test:types.

      Warning

      The suggested diff is too large to display here, but you can view it on Nx Cloud ↗


      Apply fix via Nx Cloud  Reject fix via Nx Cloud


      Or Apply changes locally with:

      npx nx-cloud apply-locally k8RL-Il32
      Apply fix locally with your editor ↗   View interactive diff ↗

      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    36. Actionable comments posted: 2

      🧹 Nitpick comments (1)
      e2e/react-router/issue-7120/package.json (1)

      14-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

      Resolve the internal workspace protocol before merging.

      These internal dependencies use workspace:^, while the current coding guideline requires workspace:*. The supplied repository learning states that e2e applications conventionally use workspace:^, so please confirm which policy governs this PR. If the current guideline is authoritative, update all three ranges:

      Proposed fix
      -    "`@tanstack/react-router`": "workspace:^",
      -    "`@tanstack/router-plugin`": "workspace:^",
      +    "`@tanstack/react-router`": "workspace:*",
      +    "`@tanstack/router-plugin`": "workspace:*",
      ...
      -    "`@tanstack/router-e2e-utils`": "workspace:^",
      +    "`@tanstack/router-e2e-utils`": "workspace:*",

      As per coding guidelines, internal dependencies in package.json must use workspace:*; based on learnings, e2e apps conventionally use workspace:^, so this policy conflict needs explicit resolution.

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@e2e/react-router/issue-7120/package.json` around lines 14 - 21, Resolve the
      policy conflict for internal workspace dependencies in this package: confirm
      whether the current guideline or the e2e convention governs this PR, then update
      all three workspace ranges in the package manifest to the authoritative
      protocol, using workspace:* if the guideline applies.

      Sources: Coding guidelines, Learnings

      🤖 Prompt for all review comments with AI agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      Inline comments:
      In @.changeset/lane-match-loader-rewrite.md:
      - Around line 2-5: Update the changeset release levels for
      `@tanstack/router-core`, `@tanstack/react-router`, `@tanstack/solid-router`, and
      `@tanstack/vue-router` from patch to major to reflect the removed public members
      and changed StartTransitionFn signature.
      
      In `@e2e/react-router/issue-7457/src/main.tsx`:
      - Around line 21-25: Declare the ambient __pendingSeen flag in
      e2e/react-router/issue-7457/src/vite-env.d.ts, then replace the any-cast global
      access in DefaultPendingComponent within
      e2e/react-router/issue-7457/src/main.tsx and the corresponding test access in
      e2e/react-router/issue-7457/tests/issue-7457.repro.spec.ts with direct
      globalThis.__pendingSeen usage.
      
      ---
      
      Nitpick comments:
      In `@e2e/react-router/issue-7120/package.json`:
      - Around line 14-21: Resolve the policy conflict for internal workspace
      dependencies in this package: confirm whether the current guideline or the e2e
      convention governs this PR, then update all three workspace ranges in the
      package manifest to the authoritative protocol, using workspace:* if the
      guideline applies.
      🪄 Autofix (Beta)

      Fix all unresolved CodeRabbit comments on this PR:

      • Push a commit to this branch (recommended)
      • Create a new PR with the fixes

      ℹ️ Review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: 51034e37-ca80-4e45-ba7e-ca5dbe8df417

      📥 Commits

      Reviewing files that changed from the base of the PR and between f4b893487ccbe027821dfc6fc74d91dd98a5402f and a4d5b8ffd88efae190d565cfc9ccafac44e3b4d3.

      📒 Files selected for processing (46)
      • .changeset/lane-match-loader-rewrite.md
      • benchmarks/memory/server/scenarios/aborted-requests/shared.ts
      • docs/router/api/router/RouteMatchType.md
      • docs/router/api/router/RouteOptionsType.md
      • docs/router/api/router/RouterOptionsType.md
      • docs/router/api/router/RouterStateType.md
      • docs/router/api/router/RouterType.md
      • docs/router/api/router/useChildMatchesHook.md
      • docs/router/api/router/useMatchesHook.md
      • docs/router/api/router/useParentMatchesHook.md
      • docs/router/guide/data-loading.md
      • docs/router/guide/path-params.md
      • docs/router/guide/preloading.md
      • docs/router/how-to/debug-router-issues.md
      • e2e/react-router/issue-7120/index.html
      • e2e/react-router/issue-7120/package.json
      • e2e/react-router/issue-7120/playwright.config.ts
      • e2e/react-router/issue-7120/src/main.tsx
      • e2e/react-router/issue-7120/src/redirectGate.ts
      • e2e/react-router/issue-7120/src/routeTree.gen.ts
      • e2e/react-router/issue-7120/src/routes/__root.tsx
      • e2e/react-router/issue-7120/src/routes/index.tsx
      • e2e/react-router/issue-7120/src/routes/posts.lazy.tsx
      • e2e/react-router/issue-7120/src/routes/posts.tsx
      • e2e/react-router/issue-7120/src/vite-env.d.ts
      • e2e/react-router/issue-7120/tests/issue-7120.repro.spec.ts
      • e2e/react-router/issue-7120/tsconfig.json
      • e2e/react-router/issue-7120/vite.config.ts
      • e2e/react-router/issue-7457/index.html
      • e2e/react-router/issue-7457/package.json
      • e2e/react-router/issue-7457/playwright.config.ts
      • e2e/react-router/issue-7457/src/main.tsx
      • e2e/react-router/issue-7457/src/routeTree.gen.ts
      • e2e/react-router/issue-7457/src/routes/__root.tsx
      • e2e/react-router/issue-7457/src/routes/another.tsx
      • e2e/react-router/issue-7457/src/routes/index.tsx
      • e2e/react-router/issue-7457/src/vite-env.d.ts
      • e2e/react-router/issue-7457/tests/issue-7457.repro.spec.ts
      • e2e/react-router/issue-7457/tsconfig.json
      • e2e/react-router/issue-7457/vite.config.js
      • e2e/react-router/scroll-restoration-sandbox-vite/tests/app.spec.ts
      • e2e/react-start/selective-ssr/src/routes/__root.tsx
      • e2e/react-start/selective-ssr/tests/app.spec.ts
      • e2e/solid-start/selective-ssr/dev-server.ts
      • e2e/solid-start/selective-ssr/playwright.config.ts
      • e2e/solid-start/selective-ssr/tests/issue-7283-dev-hydration.spec.ts
      @@ -0,0 +1,5 @@
      1+---
      2+'@tanstack/router-core': patch
      3+'@tanstack/react-router': patch
      4+'@tanstack/solid-router': patch
      5+'@tanstack/vue-router': patch
      coderabbitai[bot](GitHub profile, opens in a new tab)commented

      🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

      🧩 Analysis chain

      🏁 Script executed:

      #!/bin/bash
      set -euo pipefail
      
      echo "== changeset file =="
      cat -n .changeset/lane-match-loader-rewrite.md
      
      echo
      echo "== repo files mentioning semver / changeset / major release =="
      rg -n --hidden --glob '!**/node_modules/**' --glob '!**/.git/**' -e 'semver|major release|patch release|changeset' README* .changeset docs . 2>/dev/null | head -n 200

      Repository: TanStack/router

      Length of output: 18706


      🏁 Script executed:

      #!/bin/bash
      set -euo pipefail
      
      echo "== file list around changesets =="
      git ls-files '.changeset/*' | sed -n '1,120p'
      
      echo
      echo "== outline of the referenced changeset =="
      wc -l .changeset/lane-match-loader-rewrite.md
      sed -n '1,120p' .changeset/lane-match-loader-rewrite.md

      Repository: TanStack/router

      Length of output: 3407


      🏁 Script executed:

      #!/bin/bash
      set -euo pipefail
      
      echo "== .changeset/config.json =="
      cat -n .changeset/config.json
      
      echo
      echo "== docs / config mentioning patch or major policy =="
      rg -n --hidden --glob '!**/node_modules/**' --glob '!**/.git/**' -e 'patch.*major|major.*patch|breaking.*patch|changeset.*patch|changeset.*major|semver policy|version policy|breaking change' .changeset docs README* package.json .github . 2>/dev/null | head -n 200

      Repository: TanStack/router

      Length of output: 16531


      Use a major changeset for the API removals. The affected sections remove public members and change StartTransitionFn’s signature, so patch release metadata is inconsistent with the documented breaking surface.

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In @.changeset/lane-match-loader-rewrite.md around lines 2 - 5, Update the
      changeset release levels for `@tanstack/router-core`, `@tanstack/react-router`,
      `@tanstack/solid-router`, and `@tanstack/vue-router` from patch to major to reflect
      the removed public members and changed StartTransitionFn signature.
      @@ -0,0 +5,21 @@
      5+import { routeTree } from './routeTree.gen'
      6+
      7+const queryClient = new QueryClient()
      8+const router = createRouter({
      9+ routeTree,
      10+ context: { queryClient },
      11+ defaultPendingComponent: DefaultPendingComponent,
      12+ defaultPreloadStaleTime: 0,
      13+})
      14+
      15+declare module '@tanstack/react-router' {
      16+ interface Register {
      17+ router: typeof router
      18+ }
      19+}
      20+
      21+function DefaultPendingComponent() {
      22+ useEffect(() => {
      23+ ;(globalThis as any).__pendingSeen = true
      24+ }, [])
      25+ return <div data-testid="app-pending">loading</div>
      coderabbitai[bot](GitHub profile, opens in a new tab)commented

      📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

      🧩 Analysis chain

      🏁 Script executed:

      #!/bin/bash
      fd '^tsconfig\.json$' e2e/react-router/issue-7457 -x sh -c '
        echo "--- $1"
        sed -n "1,220p" "$1"
      ' sh {}
      
      rg -n --glob '*.{ts,tsx,d.ts}' \
        '\(globalThis as any\)\.__pendingSeen|declare global|__pendingSeen' \
        e2e/react-router/issue-7457

      Repository: TanStack/router

      Length of output: 756


      🏁 Script executed:

      #!/bin/bash
      set -euo pipefail
      
      echo "--- files"
      git ls-files e2e/react-router/issue-7457
      
      echo
      echo "--- declaration/global matches"
      rg -n --glob 'e2e/react-router/issue-7457/**/*.{ts,tsx,d.ts}' \
        'declare global|interface Window|__pendingSeen|globalThis as any' \
        e2e/react-router/issue-7457
      
      echo
      echo "--- tsconfig files"
      fd 'tsconfig\.json$' e2e/react-router/issue-7457 -x sh -c '
        echo "### $1"
        sed -n "1,220p" "$1"
      ' sh {}

      Repository: TanStack/router

      Length of output: 1377


      🏁 Script executed:

      #!/bin/bash
      set -euo pipefail
      
      echo "--- vite-env.d.ts"
      cat -n e2e/react-router/issue-7457/src/vite-env.d.ts
      
      echo
      echo "--- package.json"
      cat -n e2e/react-router/issue-7457/package.json
      
      echo
      echo "--- playwright.config.ts"
      cat -n e2e/react-router/issue-7457/playwright.config.ts

      Repository: TanStack/router

      Length of output: 2095


      Declare __pendingSeen instead of casting globalThis to any. Add the ambient flag declaration in e2e/react-router/issue-7457/src/vite-env.d.ts, then use globalThis.__pendingSeen directly in e2e/react-router/issue-7457/src/main.tsx and e2e/react-router/issue-7457/tests/issue-7457.repro.spec.ts.

      📍 Affects 2 files
      • e2e/react-router/issue-7457/src/main.tsx#L21-L25 (this comment)
      • e2e/react-router/issue-7457/tests/issue-7457.repro.spec.ts#L29-L31
      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@e2e/react-router/issue-7457/src/main.tsx` around lines 21 - 25, Declare the
      ambient __pendingSeen flag in e2e/react-router/issue-7457/src/vite-env.d.ts,
      then replace the any-cast global access in DefaultPendingComponent within
      e2e/react-router/issue-7457/src/main.tsx and the corresponding test access in
      e2e/react-router/issue-7457/tests/issue-7457.repro.spec.ts with direct
      globalThis.__pendingSeen usage.

      Source: Coding guidelines

    37. 🧹 Nitpick comments (1)
      packages/router-core/src/load-client.ts (1)

      456-463: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

      Mutating lease decrement inside the guard is easy to misread.

      --flight[2] both decrements and drives control flow, and an already-zero lease (reserved by transferPredecessorResources) would underflow to -1 and silently keep the registry entry. Consider making the reservation state explicit.

      ♻️ Suggested clarification
      -  if (!flight || --flight[2]) {
      +  if (!flight) {
      +    return
      +  }
      +  if (process.env.NODE_ENV !== 'production' && flight[2] < 1) {
      +    throw new Error('Invariant failed: releasing a flight without a lease')
      +  }
      +  if (--flight[2]) {
           return
         }
      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/router-core/src/load-client.ts` around lines 456 - 463, Update
      releaseOwnedFlight so the lease decrement is performed explicitly before the
      guard, and handle an already-zero lease as a reserved state without underflowing
      or retaining the registry entry. Preserve the existing early return for missing
      flights and only release/delete the owned flight when the resulting lease count
      indicates it is no longer reserved.
      🤖 Prompt for all review comments with AI agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      Nitpick comments:
      In `@packages/router-core/src/load-client.ts`:
      - Around line 456-463: Update releaseOwnedFlight so the lease decrement is
      performed explicitly before the guard, and handle an already-zero lease as a
      reserved state without underflowing or retaining the registry entry. Preserve
      the existing early return for missing flights and only release/delete the owned
      flight when the resulting lease count indicates it is no longer reserved.

      ℹ️ Review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 0aebeb69-11ac-4054-a1d1-fbf438a22719

      📥 Commits

      Reviewing files that changed from the base of the PR and between 2d639e1707f8017a5f250336c56a1847808a72e6 and 1d20a9dc9c69cab6d7096b760e471d2aff2f22f7.

      📒 Files selected for processing (17)
      • docs/router/api/router/RouterType.md
      • docs/router/guide/preloading.md
      • packages/react-router/src/Transitioner.tsx
      • packages/router-core/INTERNALS.md
      • packages/router-core/src/load-client.ts
      • packages/router-core/src/router.ts
      • packages/router-core/tests/issue-3928-rapid-reload-abort.test.ts
      • packages/router-core/tests/issue-6371-search-default-normalization-abort.test.ts
      • packages/router-core/tests/load.test.ts
      • packages/router-core/tests/loader-architecture-regressions.test.ts
      • packages/router-core/tests/preload-adoption.test.ts
      • packages/router-core/tests/preload-beforeload-reuse.test.ts
      • packages/router-core/tests/preload-navigation-adoption.test.ts
      • packages/router-core/tests/preload-public-cache-behavior.test.ts
      • packages/router-core/tests/public-hydration-contract.test.ts
      • packages/router-core/tests/public-preload-lane-contract.test.ts
      • packages/router-core/tests/same-destination-navigation-join.test.ts
      🚧 Files skipped from review as they are similar to previous changes (3)
      • docs/router/guide/preloading.md
      • docs/router/api/router/RouterType.md
      • packages/router-core/tests/preload-beforeload-reuse.test.ts
    38. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud has identified a possible root cause for your failed CI:

      We determined this failure is an environment state issue rather than a code regression. The error originates from a stale compiled dist artifact (e2e/e2e-utils/dist/esm/e2eSetupTeardown.js) that was missing the e2eStartDummyServer export at test execution time, even though the source file correctly defines it and the PR makes no changes to e2e-utils. The dist has since been rebuilt correctly, confirming this was a build ordering issue in the CI environment.

      No code changes were suggested for this issue.

      Trigger a rerun:

      Rerun CI

      Nx Cloud View detailed reasoning on Nx Cloud ↗


      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)
    39. 🧹 Nitpick comments (2)
      packages/router-plugin/tests/handle-route-update.test.ts (1)

      603-606: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

      Avoid unchecked any for the React act global.

      Use a typed globalThis extension so writes to IS_REACT_ACT_ENVIRONMENT remain type-checked. As per coding guidelines, “Use TypeScript strict mode with extensive type safety.”

      Proposed fix
      +const testGlobal = globalThis as typeof globalThis & {
      +  IS_REACT_ACT_ENVIRONMENT?: boolean
      +}
      +
      - delete (globalThis as any).IS_REACT_ACT_ENVIRONMENT
      + delete testGlobal.IS_REACT_ACT_ENVIRONMENT
      ...
      - ;(globalThis as any).IS_REACT_ACT_ENVIRONMENT = previousActEnvironment
      + testGlobal.IS_REACT_ACT_ENVIRONMENT = previousActEnvironment
      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/router-plugin/tests/handle-route-update.test.ts` around lines 603 -
      606, Replace the unchecked globalThis casts in the IS_REACT_ACT_ENVIRONMENT
      restoration logic with a typed globalThis extension, declaring the optional
      React act environment property in the appropriate global type scope. Keep the
      existing delete behavior for undefined values and assignment behavior for saved
      values while ensuring both writes remain type-checked.

      Source: Coding guidelines

      packages/start-server-core/tests/createStartHandler.test.ts (1)

      577-583: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

      Extract repeated onTestFinished cleanup pair into a shared helper.

      The consoleError.mockRestore() + router.serverSsr?.cleanup() pair is duplicated verbatim across this and (per the change-details) many other cancellation tests in this file. A small helper (e.g. registerCancellationCleanup(router, consoleError)) called once per test would reduce repetition and keep future changes to the cleanup sequence in one place.

      ♻️ Suggested helper
      function registerCancellationCleanup(
        router: AnyRouter,
        consoleError: ReturnType<typeof vi.spyOn>,
      ) {
        onTestFinished(() => {
          consoleError.mockRestore()
        })
        onTestFinished(() => {
          router.serverSsr?.cleanup()
        })
      }

      Then in each test:

      -      onTestFinished(() => {
      -        consoleError.mockRestore()
      -      })
      -      onTestFinished(() => {
      -        router.serverSsr?.cleanup()
      -      })
      +      registerCancellationCleanup(router, consoleError)

      Also applies to: 641-646

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/start-server-core/tests/createStartHandler.test.ts` around lines 577
      - 583, Extract the duplicated consoleError.mockRestore and
      router.serverSsr?.cleanup registrations into a shared
      registerCancellationCleanup helper near the test utilities, accepting the router
      and spy arguments. Replace both cancellation-test cleanup pairs, including the
      occurrences around the referenced tests, with one helper call per test while
      preserving cleanup order and behavior.
      🤖 Prompt for all review comments with AI agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      Nitpick comments:
      In `@packages/router-plugin/tests/handle-route-update.test.ts`:
      - Around line 603-606: Replace the unchecked globalThis casts in the
      IS_REACT_ACT_ENVIRONMENT restoration logic with a typed globalThis extension,
      declaring the optional React act environment property in the appropriate global
      type scope. Keep the existing delete behavior for undefined values and
      assignment behavior for saved values while ensuring both writes remain
      type-checked.
      
      In `@packages/start-server-core/tests/createStartHandler.test.ts`:
      - Around line 577-583: Extract the duplicated consoleError.mockRestore and
      router.serverSsr?.cleanup registrations into a shared
      registerCancellationCleanup helper near the test utilities, accepting the router
      and spy arguments. Replace both cancellation-test cleanup pairs, including the
      occurrences around the referenced tests, with one helper call per test while
      preserving cleanup order and behavior.

      ℹ️ Review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 92fb7592-301b-4518-bb89-d03cef737520

      📥 Commits

      Reviewing files that changed from the base of the PR and between 1d20a9dc9c69cab6d7096b760e471d2aff2f22f7 and b8204ea9adaeaabde7f8def033749afb67648f02.

      📒 Files selected for processing (25)
      • packages/react-router/tests/issue-4467-lazy-route-pending.test.tsx
      • packages/react-router/tests/issue-4476-react-query-cancellation.test.tsx
      • packages/react-router/tests/issue-4759-pending-frame.test.tsx
      • packages/react-router/tests/issue-6371-search-default-normalization-abort.test.tsx
      • packages/react-router/tests/preloaded-mount-resolution.test.tsx
      • packages/react-router/tests/renderRouterToStream.test.tsx
      • packages/router-core/tests/hmr-refresh-lifecycle.test.ts
      • packages/router-core/tests/hydration-currentness.test.ts
      • packages/router-core/tests/issue-4078-loader-notfound-root-boundary.test.ts
      • packages/router-core/tests/issue-5427-hydration-root-global-not-found.test.ts
      • packages/router-core/tests/issue-6221-head-waits-for-loader.test.ts
      • packages/router-core/tests/issue-7602-parent-beforeload-context-child-loader.test.ts
      • packages/router-core/tests/issue-7759-in-flight-preload-eviction.test.ts
      • packages/router-core/tests/public-hydration-contract.test.ts
      • packages/router-core/tests/public-preload-lane-contract.test.ts
      • packages/router-core/tests/server-chunk-failure-lifecycle.test.ts
      • packages/router-core/tests/ssr-server-cleanup.test.ts
      • packages/router-plugin/tests/handle-route-update.test.ts
      • packages/solid-router/tests/createLazyRoute.test.tsx
      • packages/solid-router/tests/errorComponent.test.tsx
      • packages/solid-router/tests/transitioner-listener-errors.test.tsx
      • packages/solid-router/tests/transitioner-render-ack.test.tsx
      • packages/start-server-core/tests/createStartHandler.test.ts
      • packages/vue-router/tests/Transitioner.test.tsx
      • packages/vue-router/tests/transitioner-listener-errors.test.tsx
    40. Actionable comments posted: 1

      Caution

      Some comments are outside the diff and can’t be posted inline due to platform limitations.

      ⚠️ Outside diff range comments (1)
      packages/react-router/src/Transitioner.tsx (1)

      89-101: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

      Settle any existing owner before pushing the mount acknowledgement.

      Line 20 reuses an existing array with router._rendered ??= []. Lines 94-101 push two entries without checking the current length. If acknowledgement already holds an expected/settle pair, the push writes to indexes 2 and 3. settleOwner then reads the stale entry at index 1, and MatchesInner reads the stale offered value at index 0.

      The effect can run again because its dependencies are [router, router.history], and in production mounted is undefined, so the guard at lines 56-61 does not stop the second run.

      🛡️ Proposed fix
           if (
             resolvedLocation?.href === location.href &&
             resolvedLocation.state.__TSR_key === location.state.__TSR_key
           ) {
      +      settleOwner(acknowledgement, false)
             acknowledgement.push(router.stores.matches.get(), (rendered) => {
      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/react-router/src/Transitioner.tsx` around lines 89 - 101, Before
      pushing the new expected/settle pair in the resolved-location branch, settle or
      clear any existing owner held by the reused acknowledgement array. Update the
      acknowledgement handling around router._rendered, settleOwner, and the
      acknowledgement.push call so repeated effect runs replace the prior pair rather
      than appending at indexes 2 and 3, while preserving the existing onRendered
      behavior.
      🧹 Nitpick comments (3)
      packages/react-router/tests/react-render-owner-contract.test.tsx (1)

      69-75: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

      Attach a rejection handler to firstNavigation.

      Line 70 registers only a fulfillment handler. If firstNavigation rejects, Node reports an unhandled rejection, and the failure appears as noise instead of a clear assertion failure. The test name states that the navigation settles, so record both outcomes.

      ♻️ Proposed change
         const firstSettled = vi.fn()
      -  void firstNavigation.then(firstSettled)
      +  void firstNavigation.then(firstSettled, firstSettled)
      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/react-router/tests/react-render-owner-contract.test.tsx` around
      lines 69 - 75, Update the firstNavigation settlement tracking in the test to
      register both fulfillment and rejection handlers, while preserving the existing
      firstSettled assertion and rendered-state checks. Ensure either outcome marks
      the navigation as settled without leaving a rejected promise unhandled.
      packages/react-router/src/Transitioner.tsx (1)

      27-49: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

      Consider moving the startTransition assignment out of the render body.

      Lines 27 and 49 mutate router during render. React 19 can render a component more than once before commit, and Strict Mode does this in development. The assignment is idempotent here, so the current behavior is correct. A useLayoutEffect or a module-level registration keeps the render function pure and avoids future regressions if the closure starts to capture render-scoped state.

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/react-router/src/Transitioner.tsx` around lines 27 - 49, Move the
      router.startTransition assignment and development-only _cancelTransition
      registration out of the render body into a useLayoutEffect or module-level
      registration. Preserve the existing acknowledgement handling, error rejection,
      and production/development behavior while ensuring render remains free of router
      mutations.
      packages/router-core/tests/load.test.ts (1)

      461-489: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

      Optional: merge the two shared-preload tests with test.each.

      The two tests differ only in the thrown value and the expected match state. A test.each table keeps the shared-loader contract in one place and prevents the two copies from drifting.

      Also applies to: 541-567

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/router-core/tests/load.test.ts` around lines 461 - 489, Merge the
      two shared-preload navigation tests, including the case around the pending
      preload loader and the corresponding test near the referenced range, into a
      single test.each table. Parameterize the thrown loader value and expected match
      state while keeping the shared setup, synchronization, navigation, and
      loader-call assertions in one test body.
      🤖 Prompt for all review comments with AI agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      Inline comments:
      In `@packages/react-router/src/Transitioner.tsx`:
      - Around line 31-44: Unify the production and development branches around the
      transition callback so synchronous errors from fn() use the same cleanup path.
      Update the React.startTransition handling near acknowledgement and resolve to
      clear acknowledgement when the current settle entry matches, then reject the
      error, while preserving normal transition execution in both modes.
      
      ---
      
      Outside diff comments:
      In `@packages/react-router/src/Transitioner.tsx`:
      - Around line 89-101: Before pushing the new expected/settle pair in the
      resolved-location branch, settle or clear any existing owner held by the reused
      acknowledgement array. Update the acknowledgement handling around
      router._rendered, settleOwner, and the acknowledgement.push call so repeated
      effect runs replace the prior pair rather than appending at indexes 2 and 3,
      while preserving the existing onRendered behavior.
      
      ---
      
      Nitpick comments:
      In `@packages/react-router/src/Transitioner.tsx`:
      - Around line 27-49: Move the router.startTransition assignment and
      development-only _cancelTransition registration out of the render body into a
      useLayoutEffect or module-level registration. Preserve the existing
      acknowledgement handling, error rejection, and production/development behavior
      while ensuring render remains free of router mutations.
      
      In `@packages/react-router/tests/react-render-owner-contract.test.tsx`:
      - Around line 69-75: Update the firstNavigation settlement tracking in the test
      to register both fulfillment and rejection handlers, while preserving the
      existing firstSettled assertion and rendered-state checks. Ensure either outcome
      marks the navigation as settled without leaving a rejected promise unhandled.
      
      In `@packages/router-core/tests/load.test.ts`:
      - Around line 461-489: Merge the two shared-preload navigation tests, including
      the case around the pending preload loader and the corresponding test near the
      referenced range, into a single test.each table. Parameterize the thrown loader
      value and expected match state while keeping the shared setup, synchronization,
      navigation, and loader-call assertions in one test body.
      🪄 Autofix (Beta)

      Fix all unresolved CodeRabbit comments on this PR:

      • Push a commit to this branch (recommended)
      • Create a new PR with the fixes

      ℹ️ Review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 662b8b96-2fc6-4884-8943-f632ab7b0ad7

      📥 Commits

      Reviewing files that changed from the base of the PR and between b8204ea9adaeaabde7f8def033749afb67648f02 and 00d68c45729b6ec1b5d2f64543e52751bdbf7f58.

      📒 Files selected for processing (27)
      • e2e/react-start/basic/src/routeTree.gen.ts
      • e2e/react-start/basic/src/routes/issue-6221.article.$id.tsx
      • e2e/react-start/basic/src/routes/issue-6221.dashboard.tsx
      • e2e/react-start/basic/tests/issue-6221-head.spec.ts
      • e2e/react-start/hmr/tests/app.spec.ts
      • packages/react-router/src/Matches.tsx
      • packages/react-router/src/Transitioner.tsx
      • packages/react-router/tests/component-preload-retry.test.tsx
      • packages/react-router/tests/react-render-owner-contract.test.tsx
      • packages/router-core/INTERNALS.md
      • packages/router-core/src/load-client.ts
      • packages/router-core/src/router.ts
      • packages/router-core/tests/boundary-component-chunk.test.ts
      • packages/router-core/tests/hydration-boundary-chunks.test.ts
      • packages/router-core/tests/issue-3928-rapid-reload-abort.test.ts
      • packages/router-core/tests/load.test.ts
      • packages/router-core/tests/loader-architecture-regressions.test.ts
      • packages/router-core/tests/preflight-signal-currentness.test.ts
      • packages/router-core/tests/preload-adoption.test.ts
      • packages/router-core/tests/preload-public-signal-lifetime.test.ts
      • packages/router-core/tests/public-client-loading-contract.test.ts
      • packages/router-core/tests/public-preload-lane-contract.test.ts
      • packages/router-core/tests/same-destination-navigation-join.test.ts
      • packages/solid-router/src/awaited.tsx
      • packages/solid-router/tests/createLazyRoute.test.tsx
      • packages/vue-router/src/Match.tsx
      • packages/vue-router/src/awaited.tsx
      🚧 Files skipped from review as they are similar to previous changes (3)
      • packages/router-core/tests/hydration-boundary-chunks.test.ts
      • packages/solid-router/tests/createLazyRoute.test.tsx
      • packages/router-core/tests/preload-adoption.test.ts
    41. Actionable comments posted: 1

      🤖 Prompt for all review comments with AI agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      Inline comments:
      In `@packages/react-router/tests/transitioner-render-ack.test.tsx`:
      - Around line 65-75: Update the navigation promise handling around
      router.navigate so rejected navigations are not converted into a resolved
      promise: track settlement without attaching a rejection handler that swallows
      the error, then await navigation and allow its rejection to propagate while
      preserving the existing settled assertion.
      🪄 Autofix (Beta)

      Fix all unresolved CodeRabbit comments on this PR:

      • Push a commit to this branch (recommended)
      • Create a new PR with the fixes

      ℹ️ Review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: b4ebad96-425f-4dc7-8961-9d5bfefd4bbf

      📥 Commits

      Reviewing files that changed from the base of the PR and between 00d68c45729b6ec1b5d2f64543e52751bdbf7f58 and 1c28ed70135cfa60ff06a23915b66242f93b0d67.

      📒 Files selected for processing (2)
      • packages/react-router/src/Transitioner.tsx
      • packages/react-router/tests/transitioner-render-ack.test.tsx
      🚧 Files skipped from review as they are similar to previous changes (1)
      • packages/react-router/src/Transitioner.tsx
      @@ -21,0 +55,21 @@
      55+ if (event.error === error) {
      56+ globalReport()
      57+ event.preventDefault()
      58+ }
      59+ }
      60+ window.addEventListener('error', preventGlobalReport)
      61+ testCleanups.push(() => {
      62+ window.removeEventListener('error', preventGlobalReport)
      63+ })
      64+
      65+ let settled = false
      66+ const navigation = router.navigate({ to: '/next' }).then(
      67+ () => {
      68+ settled = true
      69+ },
      70+ () => {
      71+ settled = true
      72+ },
      73+ )
      74+ await waitFor(() => expect(settled).toBe(true))
      75+ await navigation
      coderabbitai[bot](GitHub profile, opens in a new tab)commented

      🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

      Do not swallow a rejected navigation promise.

      The rejection handler marks settled and resolves navigation. This test passes if router.navigate rejects after the route renders. Let the awaited navigation reject so the test enforces the required contract.

      Proposed fix
      -  let settled = false
      -  const navigation = router.navigate({ to: '/next' }).then(
      -    () => {
      -      settled = true
      -    },
      -    () => {
      -      settled = true
      -    },
      -  )
      -  await waitFor(() => expect(settled).toBe(true))
      -  await navigation
      +  await router.navigate({ to: '/next' })
      📝 Committable suggestion

      ‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

      Suggested change
      65- let settled = false
      66- const navigation = router.navigate({ to: '/next' }).then(
      67- () => {
      68- settled = true
      69- },
      70- () => {
      71- settled = true
      72- },
      73- )
      74- await waitFor(() => expect(settled).toBe(true))
      75- await navigation
      65+ await router.navigate({ to: '/next' })
      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/react-router/tests/transitioner-render-ack.test.tsx` around lines 65
      - 75, Update the navigation promise handling around router.navigate so rejected
      navigations are not converted into a resolved promise: track settlement without
      attaching a rejection handler that swallows the error, then await navigation and
      allow its rejection to propagate while preserving the existing settled
      assertion.
    42. Important

      At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

      Nx Cloud has identified a possible root cause for your failed CI:

      We identified the failure in tanstack-react-start-e2e-rsc:test:e2e--rsbuild-ssr--shard-4-of-6 as an environment state issue: the Playwright external test server could not bind to port 32795 (EADDRINUSE), indicating another process was already occupying that port at the time of the run. Our analysis confirmed no connection to this PR's router core changes, and no similar failures were found in other branches, pointing to a transient CI infrastructure condition that should resolve on a rerun.

      No code changes were suggested for this issue.

      Trigger a rerun:

      Rerun CI

      Nx Cloud View detailed reasoning on Nx Cloud ↗


      🎓 Learn more about Self-Healing CI on [nx.dev](https://nx.dev/docs/features/ci-features/self-healing-ci?utm_source=pull-request&utm_medium=comment)

Sign in to join this conversation.