mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -05:00
Fix route validation for Netlify Edge (#4722)
* fix: serialize route pattern for Netlify edge Co-authored-by: Jackie Macharia <jackiewmacharia> * chore: changeset
This commit is contained in:
parent
49006da077
commit
4bc70f3545
2 changed files with 9 additions and 1 deletions
5
.changeset/dull-flowers-prove.md
Normal file
5
.changeset/dull-flowers-prove.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/netlify': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix route validation failures on Netlify Edge
|
|
@ -53,7 +53,10 @@ async function createEdgeManifest(routes: RouteData[], entryFile: string, dir: U
|
||||||
} else {
|
} else {
|
||||||
functions.push({
|
functions.push({
|
||||||
function: entryFile,
|
function: entryFile,
|
||||||
pattern: route.pattern.toString(),
|
// Make route pattern serializable to match expected
|
||||||
|
// Netlify Edge validation format. Mirrors Netlify's own edge bundler:
|
||||||
|
// https://github.com/netlify/edge-bundler/blob/main/src/manifest.ts#L34
|
||||||
|
pattern: route.pattern.source.replace(/\\\//g, '/').toString(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue