diff --git a/packages/remix-dev/config/flat-routes.ts b/packages/remix-dev/config/flat-routes.ts index 8b7bb5586e4..27518daada9 100644 --- a/packages/remix-dev/config/flat-routes.ts +++ b/packages/remix-dev/config/flat-routes.ts @@ -104,7 +104,7 @@ export function flatRoutes( let routes: string[] = []; for (let entry of entries) { - let filepath = path.join(routesDir, entry.name); + let filepath = normalizeSlashes(path.join(routesDir, entry.name)); let route: string | null = null; // If it's a directory, don't recurse into it, instead just look for a route module @@ -302,7 +302,7 @@ function findRouteModuleForFile( filepath: string, ignoredFileRegex: RegExp[] ): string | null { - let relativePath = path.relative(appDirectory, filepath); + let relativePath = normalizeSlashes(path.relative(appDirectory, filepath)); let isIgnored = ignoredFileRegex.some((regex) => regex.test(relativePath)); if (isIgnored) return null; return filepath;