Skip to content

Commit 07cf53c

Browse files
committed
fix(router-generator): prevent the root path "/" from being removed
1 parent 3a97163 commit 07cf53c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/router-generator/src/generator.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,8 +1247,9 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved
12471247
)
12481248

12491249
if (
1250-
node._fsRouteType === 'layout' ||
1251-
node._fsRouteType === 'pathless_layout'
1250+
(node._fsRouteType === 'layout' ||
1251+
node._fsRouteType === 'pathless_layout') &&
1252+
node.cleanedPath !== '/'
12521253
) {
12531254
node.cleanedPath = removeTrailingSlash(node.cleanedPath)
12541255
}

0 commit comments

Comments
 (0)