From 734b01bc33d473a575e0a22e9d2c935f05af050c Mon Sep 17 00:00:00 2001 From: dt_emmy Date: Sat, 22 Nov 2025 01:08:25 +0100 Subject: [PATCH 1/8] fix: Fixed the defaultNotFoundComponent as guided by #5757 --- packages/react-router/src/renderRouteNotFound.tsx | 2 +- packages/solid-router/src/renderRouteNotFound.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-router/src/renderRouteNotFound.tsx b/packages/react-router/src/renderRouteNotFound.tsx index 86f31dfc220..6a9b5670ec5 100644 --- a/packages/react-router/src/renderRouteNotFound.tsx +++ b/packages/react-router/src/renderRouteNotFound.tsx @@ -16,7 +16,7 @@ export function renderRouteNotFound( if (process.env.NODE_ENV === 'development') { warning( route.options.notFoundComponent, - `A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (
Not Found
)`, + `A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (
Not Found
)`, ) } diff --git a/packages/solid-router/src/renderRouteNotFound.tsx b/packages/solid-router/src/renderRouteNotFound.tsx index 4603e6c0a31..d11f99ad962 100644 --- a/packages/solid-router/src/renderRouteNotFound.tsx +++ b/packages/solid-router/src/renderRouteNotFound.tsx @@ -15,7 +15,7 @@ export function renderRouteNotFound( if (process.env.NODE_ENV === 'development') { warning( route.options.notFoundComponent, - `A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (
Not Found
)`, + `A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (
Not Found
)`, ) } From 6d9ba4df9e49f8e0add031a9e1da5b7ff1cdfc4e Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 22 Nov 2025 00:10:42 +0000 Subject: [PATCH 2/8] ci: apply automated fixes --- .../basic-cloudflare/worker-configuration.d.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts b/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts index b0b47f39468..cb3e271c882 100644 --- a/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts +++ b/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts @@ -2,16 +2,19 @@ // Generated by Wrangler by running `wrangler types` (hash: b11df627d8b3c51b1bf3230a546b0f20) // Runtime types generated with workerd@1.20251118.0 2025-09-24 nodejs_compat declare namespace Cloudflare { - interface Env { - MY_VAR: "Hello from Cloudflare"; - } + interface Env { + MY_VAR: 'Hello from Cloudflare' + } } interface Env extends Cloudflare.Env {} type StringifyValues> = { - [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string; -}; + [Binding in keyof EnvType]: EnvType[Binding] extends string + ? EnvType[Binding] + : string +} declare namespace NodeJS { - interface ProcessEnv extends StringifyValues> {} + interface ProcessEnv + extends StringifyValues> {} } // Begin runtime types From 568d6720be0469eed5d36d474149fb96036ef5cf Mon Sep 17 00:00:00 2001 From: dt_emmy Date: Sat, 22 Nov 2025 01:14:48 +0100 Subject: [PATCH 3/8] fix: correct from
to

tag --- packages/react-router/src/renderRouteNotFound.tsx | 2 +- packages/solid-router/src/renderRouteNotFound.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-router/src/renderRouteNotFound.tsx b/packages/react-router/src/renderRouteNotFound.tsx index 6a9b5670ec5..a042e0a727f 100644 --- a/packages/react-router/src/renderRouteNotFound.tsx +++ b/packages/react-router/src/renderRouteNotFound.tsx @@ -16,7 +16,7 @@ export function renderRouteNotFound( if (process.env.NODE_ENV === 'development') { warning( route.options.notFoundComponent, - `A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (

Not Found
)`, + `A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (

Not Found

)`, ) } diff --git a/packages/solid-router/src/renderRouteNotFound.tsx b/packages/solid-router/src/renderRouteNotFound.tsx index d11f99ad962..172665c8535 100644 --- a/packages/solid-router/src/renderRouteNotFound.tsx +++ b/packages/solid-router/src/renderRouteNotFound.tsx @@ -15,7 +15,7 @@ export function renderRouteNotFound( if (process.env.NODE_ENV === 'development') { warning( route.options.notFoundComponent, - `A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (
Not Found
)`, + `A notFoundError was encountered on the route with ID "${route.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (

Not Found

)`, ) } From 1b8ba2341879b74af303eae040074f71a401b351 Mon Sep 17 00:00:00 2001 From: dt_emmy Date: Sat, 22 Nov 2025 01:27:44 +0100 Subject: [PATCH 4/8] chore: added docstring to renderRouteNotFound.tsx for both react-router and solid-router --- packages/react-router/src/renderRouteNotFound.tsx | 8 ++++++++ packages/solid-router/src/renderRouteNotFound.tsx | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/react-router/src/renderRouteNotFound.tsx b/packages/react-router/src/renderRouteNotFound.tsx index a042e0a727f..67b6f904540 100644 --- a/packages/react-router/src/renderRouteNotFound.tsx +++ b/packages/react-router/src/renderRouteNotFound.tsx @@ -3,6 +3,14 @@ import warning from 'tiny-warning' import { DefaultGlobalNotFound } from './not-found' import type { AnyRoute, AnyRouter } from '@tanstack/router-core' +/** + * Renders a not found component for a route when no matching route is found. + * + * @param router - The router instance containing the route configuration + * @param route - The route that triggered the not found state + * @param data - Additional data to pass to the not found component + * @returns The rendered not found component or a default fallback component + */ export function renderRouteNotFound( router: AnyRouter, route: AnyRoute, diff --git a/packages/solid-router/src/renderRouteNotFound.tsx b/packages/solid-router/src/renderRouteNotFound.tsx index 172665c8535..f899e7069d7 100644 --- a/packages/solid-router/src/renderRouteNotFound.tsx +++ b/packages/solid-router/src/renderRouteNotFound.tsx @@ -2,6 +2,14 @@ import warning from 'tiny-warning' import { DefaultGlobalNotFound } from './not-found' import type { AnyRoute, AnyRouter } from '@tanstack/router-core' +/** + * Renders a not found component for a route when no matching route is found. + * + * @param router - The router instance containing the route configuration + * @param route - The route that triggered the not found state + * @param data - Additional data to pass to the not found component + * @returns The rendered not found component or a default fallback component + */ export function renderRouteNotFound( router: AnyRouter, route: AnyRoute, From df3c1a4ba5fdd34b2a4e3567e63c9e0aef2e3641 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 22 Nov 2025 00:28:59 +0000 Subject: [PATCH 5/8] ci: apply automated fixes --- packages/react-router/src/renderRouteNotFound.tsx | 2 +- packages/solid-router/src/renderRouteNotFound.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-router/src/renderRouteNotFound.tsx b/packages/react-router/src/renderRouteNotFound.tsx index 67b6f904540..225a013beae 100644 --- a/packages/react-router/src/renderRouteNotFound.tsx +++ b/packages/react-router/src/renderRouteNotFound.tsx @@ -5,7 +5,7 @@ import type { AnyRoute, AnyRouter } from '@tanstack/router-core' /** * Renders a not found component for a route when no matching route is found. - * + * * @param router - The router instance containing the route configuration * @param route - The route that triggered the not found state * @param data - Additional data to pass to the not found component diff --git a/packages/solid-router/src/renderRouteNotFound.tsx b/packages/solid-router/src/renderRouteNotFound.tsx index f899e7069d7..9160e624995 100644 --- a/packages/solid-router/src/renderRouteNotFound.tsx +++ b/packages/solid-router/src/renderRouteNotFound.tsx @@ -4,7 +4,7 @@ import type { AnyRoute, AnyRouter } from '@tanstack/router-core' /** * Renders a not found component for a route when no matching route is found. - * + * * @param router - The router instance containing the route configuration * @param route - The route that triggered the not found state * @param data - Additional data to pass to the not found component From 9e20634858fb4775d0d1a0fb3388d95a4fa840f9 Mon Sep 17 00:00:00 2001 From: dt_emmy Date: Sat, 22 Nov 2025 02:08:50 +0100 Subject: [PATCH 6/8] chore: revert file changes by autofix-ci[bot] --- .../basic-cloudflare/worker-configuration.d.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts b/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts index cb3e271c882..df5a3a53fa5 100644 --- a/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts +++ b/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts @@ -2,19 +2,16 @@ // Generated by Wrangler by running `wrangler types` (hash: b11df627d8b3c51b1bf3230a546b0f20) // Runtime types generated with workerd@1.20251118.0 2025-09-24 nodejs_compat declare namespace Cloudflare { - interface Env { - MY_VAR: 'Hello from Cloudflare' - } + interface Env { + MY_VAR: "Hello from Cloudflare"; + } } interface Env extends Cloudflare.Env {} type StringifyValues> = { - [Binding in keyof EnvType]: EnvType[Binding] extends string - ? EnvType[Binding] - : string -} + [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string; +}; declare namespace NodeJS { - interface ProcessEnv - extends StringifyValues> {} + interface ProcessEnv extends StringifyValues> {} } // Begin runtime types @@ -10350,4 +10347,4 @@ declare abstract class WorkflowInstance { type: string payload: unknown }): Promise -} +} \ No newline at end of file From 7367a6b79a4b6eaabb5b9087e0f660eb10941781 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 22 Nov 2025 01:10:43 +0000 Subject: [PATCH 7/8] ci: apply automated fixes --- .../basic-cloudflare/worker-configuration.d.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts b/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts index df5a3a53fa5..cb3e271c882 100644 --- a/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts +++ b/e2e/solid-start/basic-cloudflare/worker-configuration.d.ts @@ -2,16 +2,19 @@ // Generated by Wrangler by running `wrangler types` (hash: b11df627d8b3c51b1bf3230a546b0f20) // Runtime types generated with workerd@1.20251118.0 2025-09-24 nodejs_compat declare namespace Cloudflare { - interface Env { - MY_VAR: "Hello from Cloudflare"; - } + interface Env { + MY_VAR: 'Hello from Cloudflare' + } } interface Env extends Cloudflare.Env {} type StringifyValues> = { - [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string; -}; + [Binding in keyof EnvType]: EnvType[Binding] extends string + ? EnvType[Binding] + : string +} declare namespace NodeJS { - interface ProcessEnv extends StringifyValues> {} + interface ProcessEnv + extends StringifyValues> {} } // Begin runtime types @@ -10347,4 +10350,4 @@ declare abstract class WorkflowInstance { type: string payload: unknown }): Promise -} \ No newline at end of file +} From 8337a02136601233acbcd2d5de7d7ea09da3d9bc Mon Sep 17 00:00:00 2001 From: dt_emmy Date: Sat, 22 Nov 2025 15:00:02 +0100 Subject: [PATCH 8/8] chore: cleanup documentation of not-found-errors.md --- docs/router/framework/react/guide/not-found-errors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/router/framework/react/guide/not-found-errors.md b/docs/router/framework/react/guide/not-found-errors.md index 36d5a0bdd4d..e370a805aa3 100644 --- a/docs/router/framework/react/guide/not-found-errors.md +++ b/docs/router/framework/react/guide/not-found-errors.md @@ -164,7 +164,7 @@ export const Route = createFileRoute('/posts/$postId')({ The not-found error above will be handled by the same route or nearest parent route that has either a `notFoundComponent` route option or the `defaultNotFoundComponent` router option configured. -If neither the route nor any suitable parent route is found to handle the error, the root route will handle it using TanStack Router's **extremely basic (and purposefully undesirable)** default not-found component that simply renders `
Not Found
`. It's highly recommended to either attach at least one `notFoundComponent` to the root route or configure a router-wide `defaultNotFoundComponent` to handle not-found errors. +If neither the route nor any suitable parent route is found to handle the error, the root route will handle it using TanStack Router's **extremely basic (and purposefully undesirable)** default not-found component that simply renders `

Not Found

`. It's highly recommended to either attach at least one `notFoundComponent` to the root route or configure a router-wide `defaultNotFoundComponent` to handle not-found errors. > ⚠️ Throwing a notFound error in a beforeLoad method will always trigger the \_\_root notFoundComponent. Since beforeLoad methods are run prior to the route loader methods, there is no guarantee that any required data for layouts have successfully loaded before the error is thrown.