diff --git a/packages/router-core/src/router.ts b/packages/router-core/src/router.ts index 29c3cf2af5..ae2182d7f0 100644 --- a/packages/router-core/src/router.ts +++ b/packages/router-core/src/router.ts @@ -3225,6 +3225,13 @@ export function getMatchedRoutes({ routeParams = getMatchedParams(foundRoute)! } else { foundRoute = flatRoutes.find((route) => { + // If there are child routes, check if any of them have the same path as the current route + if (route.children && route.children.length > 0) { + if (!route.children.find((child) => child.path === '/')) { + return false + } + } + const matchedParams = getMatchedParams(route) if (matchedParams) {