Skip to content

Commit 6bc7f5b

Browse files
committed
fix(router-generator): prevent the root path "/" from being removed
1 parent c3af4b8 commit 6bc7f5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/router-generator/src/generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved
12471247
)
12481248

12491249
if (
1250-
node._fsRouteType === 'layout' ||
1250+
(node._fsRouteType === 'layout' && node.cleanedPath !== '/') ||
12511251
node._fsRouteType === 'pathless_layout'
12521252
) {
12531253
node.cleanedPath = removeTrailingSlash(node.cleanedPath)

0 commit comments

Comments
 (0)