From 6bc7f5b0670890ff37cee4a5f3cad44e72d790d5 Mon Sep 17 00:00:00 2001 From: CHEN Xian-an Date: Wed, 19 Nov 2025 15:21:12 +0800 Subject: [PATCH] fix(router-generator): prevent the root path "/" from being removed --- packages/router-generator/src/generator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/router-generator/src/generator.ts b/packages/router-generator/src/generator.ts index 54a16e265b6..94fbafd9223 100644 --- a/packages/router-generator/src/generator.ts +++ b/packages/router-generator/src/generator.ts @@ -1247,7 +1247,7 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved ) if ( - node._fsRouteType === 'layout' || + (node._fsRouteType === 'layout' && node.cleanedPath !== '/') || node._fsRouteType === 'pathless_layout' ) { node.cleanedPath = removeTrailingSlash(node.cleanedPath)