diff --git a/packages/remix-dev/vite/styles.ts b/packages/remix-dev/vite/styles.ts index c2421a545ee..899f880f844 100644 --- a/packages/remix-dev/vite/styles.ts +++ b/packages/remix-dev/vite/styles.ts @@ -168,6 +168,7 @@ export const getStylesForUrl = async ( let routes = createRoutes(build.routes); let appPath = path.relative(process.cwd(), config.appDirectory); + // TODO: basename let documentRouteFiles = matchRoutes(routes, url)?.map((match) => path.join(appPath, config.routes[match.route.id].file) diff --git a/packages/remix-react/components.tsx b/packages/remix-react/components.tsx index caa4dd7fa91..d9c77ebfc92 100644 --- a/packages/remix-react/components.tsx +++ b/packages/remix-react/components.tsx @@ -319,7 +319,7 @@ export function PrefetchPageLinks({ }: PrefetchPageDescriptor) { let { router } = useDataRouterContext(); let matches = React.useMemo( - () => matchRoutes(router.routes, page), + () => matchRoutes(router.routes, page, router.basename), [router.routes, page] ); @@ -833,7 +833,11 @@ import(${JSON.stringify(manifest.entry.module)});`; let nextMatches = React.useMemo(() => { if (navigation.location) { // FIXME: can probably use transitionManager `nextMatches` - let matches = matchRoutes(router.routes, navigation.location); + let matches = matchRoutes( + router.routes, + navigation.location, + router.basename + ); invariant( matches, `No routes match path "${navigation.location.pathname}"` diff --git a/packages/remix-server-runtime/routeMatching.ts b/packages/remix-server-runtime/routeMatching.ts index 54a4c5265c8..9687847a110 100644 --- a/packages/remix-server-runtime/routeMatching.ts +++ b/packages/remix-server-runtime/routeMatching.ts @@ -13,6 +13,7 @@ export function matchServerRoutes( routes: ServerRoute[], pathname: string ): RouteMatch[] | null { + // TODO: basename let matches = matchRoutes( routes as unknown as AgnosticRouteObject[], pathname