Skip to content

Commit 4b2b0d3

Browse files
committed
Fix Pages Functions path routing on Windows
1 parent 9c10098 commit 4b2b0d3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/funny-peas-call.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Fixed Pages Functions path routing on Windows

packages/wrangler/pages/functions/filepath-routing.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ export async function generateConfigFromFileTree({
9393

9494
let routePath = path
9595
.relative(baseDir, filepath)
96-
.slice(0, -ext.length);
96+
.slice(0, -ext.length)
97+
.replaceAll(path.win32.sep, "/");
9798

9899
if (isIndexFile || isMiddlewareFile) {
99100
routePath = path.dirname(routePath);

0 commit comments

Comments
 (0)