Skip to content

Commit 5e67f53

Browse files
committed
fix: decode Windows paths to prevent ENOENT in dev mode
1 parent 53b8251 commit 5e67f53

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-router-dev/vite/plugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3650,7 +3650,9 @@ export async function getEnvironmentOptionsResolvers(
36503650
let isRootRoute =
36513651
route.file === ctx.reactRouterConfig.routes.root.file;
36523652

3653-
let code = readFileSync(routeFilePath, "utf-8");
3653+
let cleanPath = path.normalize(decodeURIComponent(routeFilePath));
3654+
let code = readFileSync(cleanPath, "utf-8");
3655+
36543656

36553657
return [
36563658
`${routeFilePath}${BUILD_CLIENT_ROUTE_QUERY_STRING}`,

0 commit comments

Comments
 (0)