diff --git a/packages/remix-dev/config/flat-routes.ts b/packages/remix-dev/config/flat-routes.ts index 475dd30f43b..659ba92c4c1 100644 --- a/packages/remix-dev/config/flat-routes.ts +++ b/packages/remix-dev/config/flat-routes.ts @@ -98,7 +98,7 @@ export function flatRoutesUniversal( }; if (index) { - let invalidChildRoutes = Object.values(routeMap).filter( + let invalidChildRoutes = routes.filter( (routeInfo) => routeInfo.parentId === childRoute.id ); @@ -348,7 +348,7 @@ function getRouteMap( appDirectory: string, routePaths: string[], prefix: string -) { +): Readonly> { let routeMap = new Map(); let nameMap = new Map();