fix: serial head execution #6093
main fromrefs/pull/6093/head·merged by schiller-manuel(GitHub profile, opens in a new tab) fixes #6085 fixes #4785 fixes #4889
Summary by CodeRabbit#
- Bug Fixes
- Router waits for all loaders to settle, defers applying head metadata until after loaders complete, logs head errors without stopping other heads, and improves redirect and 404 handling.
- Chores
- Removed the not-found "via-head" route and its UI links; removed related prerender exclusion entries.
- Tests
- E2E not-found tests narrowed to loader-only thrower scenarios (removed head thrower).
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-core
🤖 Nx Cloud AI Fix Eligible#
To disable these notifications, a workspace admin can disable them [in workspace settings.](https://cloud.nx.app/orgs/6412ca9d1c251d000efa21ba/workspaces/6442f7de8226a6291646a813/settings/self-healing-ci?utm_source=pull-request&utm_medium=comment)An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.
View your CI Pipeline Execution ↗ for commit 815e77b06eb40410189cc2a46c73952821ca6d9b
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...❌ Failed 9m 59s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 1m 41s View ↗
☁️ Nx Cloud last updated this comment at
2025-12-23 01:54:21UTCActionable comments posted: 0
🧹 Nitpick comments (2)
packages/router-core/src/load-matches.ts (2)
917-933: Consider limiting head execution to successfully loaded matches.The loop iterates over all
inner.matches, but loaders only execute for matches up toinner.firstBadMatchIndex(line 896-898). Matches beyond this index may have incomplete state (no loader data), which could cause unexpected behavior in head functions that depend onloaderData.Consider aligning the head execution range with the loader execution range:
- for (const match of inner.matches) { + const headMax = inner.firstBadMatchIndex ?? inner.matches.length + for (let i = 0; i < headMax; i++) { + const match = inner.matches[i]! const { id: matchId, routeId } = matchAlternatively, if executing heads for all matches is intentional (even failed ones), please add a comment clarifying this design choice.
916-916: Address TODO: decide on head execution failure behavior.The current implementation continues executing other head functions when one fails, which is resilient but may mask issues in development. Consider documenting the chosen behavior or removing the TODO if the current approach is final.
Would you like me to open an issue to track this decision, or is the current continue-on-failure behavior the intended final design?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 85bf22e57813a3fc582866fb3b6bf39aec31dc94 and aca0594e82df8bc2bb87aebeab6a962f323abe0c.
📒 Files selected for processing (1)
packages/router-core/src/load-matches.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript strict mode with extensive type safety for all code
Files:
packages/router-core/src/load-matches.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Implement ESLint rules for router best practices using the ESLint plugin router
Files:
packages/router-core/src/load-matches.ts
🧬 Code graph analysis (1)
packages/router-core/src/load-matches.ts (1)
packages/router-core/src/index.ts (2)
isRedirect(368-368)isNotFound(374-374)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Test
- GitHub Check: Preview
🔇 Additional comments (3)
packages/router-core/src/load-matches.ts (3)
900-905: LGTM -Promise.allSettledusage is appropriate here.Using
Promise.allSettledensures all loaders complete before processing results, which aligns with the goal of deferring head execution until all loaders settle. The failure extraction logic is correct.
907-912: Redirect early-exit logic is correct.Throwing on the first redirect before head execution is the right approach - there's no need to compute head metadata when redirecting.
935-940: NotFound handling after head execution is appropriate.The asymmetry with redirect handling (redirect throws before head, notFound throws after head) is intentional and makes sense - a notFound page can still benefit from head metadata, while a redirect doesn't need any rendering.
More templates
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-i18n-paraglide
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-router-react-example-basic-authjs
- tanstack-start-example-basic-cloudflare
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-rsc
- tanstack-start-example-basic-static
- tanstack-start-bun-hosting
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-i18n-paraglide
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-streaming-data-from-server-functions
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
- tanstack-router-vue-example-basic-jsx
- tanstack-router-vue-example-basic-file-based-jsx
- tanstack-router-vue-example-basic-file-based-sfc
- tanstack-router-solid-example-authenticated-routes
- tanstack-router-solid-example-authenticated-routes-firebase
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-default-search-params
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-basic-virtual-file-based
- tanstack-router-solid-example-basic-virtual-inside-file-based
- tanstack-router-solid-example-deferred-data
- tanstack-router-solid-i18n-paraglide
- tanstack-router-solid-example-kitchen-sink
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-kitchen-sink-solid-query
- tanstack-router-solid-example-kitchen-sink-solid-query-file-based
- tanstack-router-solid-example-large-file-based
- tanstack-router-solid-example-location-masking
- tanstack-router-solid-example-navigation-blocking
- tanstack-router-solid-example-quickstart
- tanstack-router-solid-example-quickstart-esbuild-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-router-solid-example-quickstart-rspack-file-based
- tanstack-router-solid-example-quickstart-webpack-file-based
- @tanstack/router-solid-mono-simple
- router-solid-mono-simple-lazy
- router-solid-monorepo-solid-query
- tanstack-router-solid-example-scroll-restoration
- tanstack-solid-router-search-validator-adapters
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-auth
- tanstack-solid-start-example-basic-authjs
- tanstack-solid-start-example-basic-cloudflare
- tanstack-solid-start-example-basic-netlify
- tanstack-solid-start-example-basic-nitro
- tanstack-start-example-basic-solid-query
- tanstack-solid-start-example-basic-static
- tanstack-solid-start-bun-hosting
- tanstack-solid-start-example-convex-better-auth
- tanstack-solid-start-example-counter
- tanstack-solid-start-i18n-paraglide
- tanstack-solid-start-example-large
- tanstack-solid-start-streaming-data-from-server-functions
- tanstack-solid-start-example-supabase-basic
- tanstack-solid-start-tailwind-v4
- tanstack-router-solid-example-view-transitions
- tanstack-router-solid-example-with-framer-motion
- tanstack-router-solid-example-with-trpc
@tanstack/arktype-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@6093@tanstack/directive-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@6093@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@6093@tanstack/history
npm i https://pkg.pr.new/TanStack/router/@tanstack/history@6093@tanstack/nitro-v2-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@6093@tanstack/react-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@6093@tanstack/react-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@6093@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@6093@tanstack/react-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@6093@tanstack/react-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@6093@tanstack/react-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@6093@tanstack/router-cli
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@6093@tanstack/router-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@6093@tanstack/router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@6093@tanstack/router-devtools-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@6093@tanstack/router-generator
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@6093@tanstack/router-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@6093@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@6093@tanstack/router-utils
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@6093@tanstack/router-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@6093@tanstack/server-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@6093@tanstack/solid-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@6093@tanstack/solid-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@6093@tanstack/solid-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@6093@tanstack/solid-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@6093@tanstack/solid-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@6093@tanstack/solid-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@6093@tanstack/start-client-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@6093@tanstack/start-fn-stubs
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-fn-stubs@6093@tanstack/start-plugin-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@6093@tanstack/start-server-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@6093@tanstack/start-static-server-functions
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@6093@tanstack/start-storage-context
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@6093@tanstack/valibot-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@6093@tanstack/virtual-file-routes
npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@6093@tanstack/vue-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router@6093@tanstack/vue-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router-devtools@6093@tanstack/vue-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router-ssr-query@6093@tanstack/vue-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start@6093@tanstack/vue-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-client@6093@tanstack/vue-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-server@6093@tanstack/zod-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@6093commit:
815e77b- packages/router-core/src/load-matches.ts lines 935 to 940Outdated@@ -934,0 +920,21 @@920+ try {921+ const headResult = executeHead(inner, matchId, route)922+ if (headResult) {923+ const head = await headResult924+ inner.updateMatch(matchId, (prev) => ({925+ ...prev,926+ ...head,927+ }))928+ }929+ } catch (err) {930+ // Log error but continue executing other head functions931+ console.error(`Error executing head for route ${routeId}:`, err)932+ }933+ }934+935+ // After head execution, check for notFound errors and throw the first one936+ for (const err of failures) {937+ if (isNotFound(err)) {938+ throw err939+ }940+ }
I find it a little curious that we call
executeHeadfor children of amatchthat would have thrown anotFoundIf we have
/a/b/cand/bthrows anotFoundit itsloader, should we really still execute theheadof/c? It feels "leaky" Actionable comments posted: 1
♻️ Duplicate comments (1)
e2e/solid-start/basic/tests/not-found.spec.ts (1)
29-29: Verify consistency: 'head' removed from navigation tests but retained in direct visit tests.This file has the same inconsistency as the React Start test file. The enriched summary indicates that the via-head route file was removed, yet line 61 still includes 'head' in the directVisitTestMatrix. This will cause test failures when the direct visit test attempts to navigate to
/not-found/via-head.Given that this PR addresses head execution issues with notFound() (PR objectives #6085), removing test coverage for navigation scenarios where notFound is thrown from head() appears inconsistent with the PR's goals.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between aca0594e82df8bc2bb87aebeab6a962f323abe0c and 921730e138ba90f991d718e4a0c3ff1cf16f8f61.
📒 Files selected for processing (4)
e2e/react-start/basic/src/routes/not-found/via-head.tsxe2e/react-start/basic/tests/not-found.spec.tse2e/solid-start/basic/src/routes/not-found/via-head.tsxe2e/solid-start/basic/tests/not-found.spec.ts
💤 Files with no reviewable changes (2)
- e2e/solid-start/basic/src/routes/not-found/via-head.tsx
- e2e/react-start/basic/src/routes/not-found/via-head.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript strict mode with extensive type safety for all code
Files:
e2e/solid-start/basic/tests/not-found.spec.tse2e/react-start/basic/tests/not-found.spec.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Implement ESLint rules for router best practices using the ESLint plugin router
Files:
e2e/solid-start/basic/tests/not-found.spec.tse2e/react-start/basic/tests/not-found.spec.ts
🧠 Learnings (3)
📚 Learning: 2025-10-09T12:59:02.129Z
Learnt from: hokkyss Repo: TanStack/router PR: 5418 File: e2e/react-start/custom-identifier-prefix/src/styles/app.css:19-21 Timestamp: 2025-10-09T12:59:02.129Z Learning: In e2e test directories (paths containing `e2e/`), accessibility concerns like outline suppression patterns are less critical since the code is for testing purposes, not production use.Applied to files:
e2e/solid-start/basic/tests/not-found.spec.tse2e/react-start/basic/tests/not-found.spec.ts
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad Repo: TanStack/router PR: 5402 File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21 Timestamp: 2025-10-08T08:11:47.088Z Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.Applied to files:
e2e/solid-start/basic/tests/not-found.spec.tse2e/react-start/basic/tests/not-found.spec.ts
📚 Learning: 2025-10-09T12:59:14.842Z
Learnt from: hokkyss Repo: TanStack/router PR: 5418 File: e2e/react-start/custom-identifier-prefix/public/site.webmanifest:2-3 Timestamp: 2025-10-09T12:59:14.842Z Learning: In e2e test fixtures (files under e2e directories), empty or placeholder values in configuration files like site.webmanifest are acceptable and should not be flagged unless the test specifically validates those fields.Applied to files:
e2e/solid-start/basic/tests/not-found.spec.tse2e/react-start/basic/tests/not-found.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Preview
- GitHub Check: Test
@@ -26,4 +26,4 @@2626 test.describe('throw notFound()', () => {2727 const navigationTestMatrix = combinate({2828 // TODO beforeLoad!29- thrower: [/* 'beforeLoad',*/ 'head', 'loader'] as const,29+ thrower: [/* 'beforeLoad',*/ 'loader'] as const,⚠️ Potential issue | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # First, find the test file if [ -f "e2e/react-start/basic/tests/not-found.spec.ts" ]; then echo "=== Test file found ===" wc -l "e2e/react-start/basic/tests/not-found.spec.ts" echo "" echo "=== Lines 25-35 (around line 29) ===" sed -n '25,35p' "e2e/react-start/basic/tests/not-found.spec.ts" echo "" echo "=== Lines 55-70 (around line 61) ===" sed -n '55,70p' "e2e/react-start/basic/tests/not-found.spec.ts" else echo "Test file not found at e2e/react-start/basic/tests/not-found.spec.ts" # Try to find it fd -t f "not-found.spec.ts" e2e/ fiRepository: TanStack/router
Length of output: 1108
🏁 Script executed:
#!/bin/bash # Search for via-head route files echo "=== Searching for via-head route files ===" fd -type f "via-head" e2e/ echo "" echo "=== Also checking for any via-head references ===" rg "via-head" e2e/ --type ts --type tsx -lRepository: TanStack/router
Length of output: 368
🏁 Script executed:
#!/bin/bash echo "=== Searching for not-found route files ===" find e2e/react-start/basic/app/routes -name "*not-found*" -type f 2>/dev/null | head -20 echo "" echo "=== Looking for via-* route files ===" find e2e/react-start/basic/app/routes -name "via-*" -type f 2>/dev/null echo "" echo "=== List all routes in not-found directory ===" find e2e/react-start/basic/app/routes/not-found -type f 2>/dev/nullRepository: TanStack/router
Length of output: 189
🏁 Script executed:
#!/bin/bash # Check the actual test to see what routes it expects and what the tests do echo "=== Full test file context (lines 15-77) ===" sed -n '15,77p' "e2e/react-start/basic/tests/not-found.spec.ts"Repository: TanStack/router
Length of output: 1983
🏁 Script executed:
#!/bin/bash echo "=== Check if not-found directory exists ===" ls -la e2e/react-start/basic/app/routes/ | grep -i "not-found" || echo "No not-found directory found" echo "" echo "=== List the entire routes directory structure ===" find e2e/react-start/basic/app/routes -maxdepth 2 -type d | sort echo "" echo "=== Search for files containing 'via-' or 'notFound' in routes ===" grep -r "via-" e2e/react-start/basic/app/routes --include="*.ts" --include="*.tsx" 2>/dev/null | head -10 || echo "No via- references found in routes"Repository: TanStack/router
Length of output: 417
🏁 Script executed:
#!/bin/bash echo "=== Check for any head function/method in test routes ===" grep -r "head" e2e/react-start/basic/app/routes --include="*.ts" --include="*.tsx" -B2 -A2 2>/dev/null | head -40 || echo "No head references found"Repository: TanStack/router
Length of output: 116
🏁 Script executed:
#!/bin/bash echo "=== Find the actual e2e app directory structure ===" find e2e/react-start/basic -maxdepth 3 -type d | head -20 echo "" echo "=== List files in e2e/react-start/basic ===" ls -la e2e/react-start/basic/Repository: TanStack/router
Length of output: 1496
🏁 Script executed:
#!/bin/bash echo "=== List all files in not-found directory ===" find e2e/react-start/basic/src/routes/not-found -type f | sort echo "" echo "=== Content of not-found directory ===" ls -la e2e/react-start/basic/src/routes/not-found/Repository: TanStack/router
Length of output: 732
🏁 Script executed:
#!/bin/bash echo "=== Check via-loader.tsx to understand the pattern ===" cat e2e/react-start/basic/src/routes/not-found/via-loader.tsx echo "" echo "=== Check for any references to via-head in the entire codebase ===" grep -r "via-head" e2e/react-start/basic --include="*.ts" --include="*.tsx" --include="*.js"Repository: TanStack/router
Length of output: 2084
🏁 Script executed:
#!/bin/bash echo "=== Check if via-head.tsx file actually exists ===" if [ -f "e2e/react-start/basic/src/routes/not-found/via-head.tsx" ]; then echo "via-head.tsx EXISTS" cat e2e/react-start/basic/src/routes/not-found/via-head.tsx else echo "via-head.tsx DOES NOT EXIST" fi echo "" echo "=== Check the index.tsx to see the link structure ===" cat e2e/react-start/basic/src/routes/not-found/index.tsxRepository: TanStack/router
Length of output: 1193
Remove 'head' from directVisitTestMatrix to match navigationTestMatrix
The
via-head.tsxroute file does not exist in the not-found routes directory. ThenavigationTestMatrix(line 29) correctly excludes 'head' from the thrower options, butdirectVisitTestMatrix(line 61) still includes it. This will cause the direct visit test to fail when attempting to navigate to the non-existent/not-found/via-headroute. Either restore thevia-head.tsxroute file or remove 'head' fromdirectVisitTestMatrixto align with the navigation test configuration.🤖 Prompt for AI Agents
In e2e/react-start/basic/tests/not-found.spec.ts around lines 29 and 61, the navigationTestMatrix correctly excludes 'head' but directVisitTestMatrix still includes 'head', which points to a non-existent via-head.tsx route and will fail direct-visit tests; fix by removing 'head' from the directVisitTestMatrix thrower options (or alternatively restore the via-head.tsx route file if that behavior is required) so both matrices match and no test attempts to visit /not-found/via-head.✅ Addressed in commit b4890a8
Sign in to join this conversation.
Walkthrough#
Defer route head execution until after all loader Promises settle (use Promise.allSettled). Run heads serially with guarded try/catch, surface redirects immediately after loaders settle, and throw notFound errors after head processing. Removed file-based via-head not-found routes and updated related tests and prerender filters.
Changes#
packages/router-core/src/load-matches.tse2e/react-start/basic/src/routes/not-found/via-head.tsx,e2e/solid-start/basic/src/routes/not-found/via-head.tsx,e2e/vue-start/basic/.../src/routes/not-found/via-head.tsxRoutedeclarations, head handlers, notFoundComponent, and route components.e2e/react-start/basic/src/routeTree.gen.ts,e2e/solid-start/basic/src/routeTree.gen.ts,e2e/vue-start/basic/src/routeTree.gen.ts/not-found/via-headacross generated route maps and types.e2e/react-start/basic/src/routes/not-found/index.tsx,e2e/solid-start/basic/src/routes/not-found/index.tsx,e2e/vue-start/basic/src/routes/not-found/index.tsx./via-headfrom not-found index pages.e2e/react-start/basic/tests/not-found.spec.ts,e2e/solid-start/basic/tests/not-found.spec.ts,e2e/vue-start/basic/tests/not-found.spec.ts'head'from thrower scenarios in navigation and direct-visit test matrices (left'loader'only).e2e/react-start/basic/vite.config.ts,e2e/solid-start/basic/vite.config.ts,e2e/vue-start/basic/vite.config.ts/not-found/via-headfrom prerender exclusion filters.Sequence Diagram(s)#
Estimated code review effort#
🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs#
packages/router-core/src/load-matches.ts.Suggested reviewers#
Pre-merge checks and finishing touches#
❌ Failed checks (1 warning)
@coderabbitai generate docstringsto improve docstring coverage.✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 87908f3e5295bae03182964a22813c99073cc135 and 815e77b06eb40410189cc2a46c73952821ca6d9b.
📒 Files selected for processing (1)
packages/router-core/src/load-matches.ts🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Files:
packages/router-core/src/load-matches.ts**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Files:
packages/router-core/src/load-matches.ts🧠 Learnings (3)
📚 Learning: 2025-12-21T12:52:35.231Z
Applied to files:
packages/router-core/src/load-matches.ts📚 Learning: 2025-10-08T08:11:47.088Z
Applied to files:
packages/router-core/src/load-matches.ts📚 Learning: 2025-10-01T18:30:26.591Z
Applied to files:
packages/router-core/src/load-matches.ts⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (2)
Comment `@coderabbitai help` to get the list of available commands and usage tips.