diff --git a/.changeset/dull-flowers-prove.md b/.changeset/dull-flowers-prove.md new file mode 100644 index 000000000000..8a0e05299ac4 --- /dev/null +++ b/.changeset/dull-flowers-prove.md @@ -0,0 +1,5 @@ +--- +'@astrojs/netlify': patch +--- + +Fix route validation failures on Netlify Edge diff --git a/packages/integrations/netlify/src/integration-edge-functions.ts b/packages/integrations/netlify/src/integration-edge-functions.ts index 72ab6fb19b2c..11a18beb9e70 100644 --- a/packages/integrations/netlify/src/integration-edge-functions.ts +++ b/packages/integrations/netlify/src/integration-edge-functions.ts @@ -53,7 +53,10 @@ async function createEdgeManifest(routes: RouteData[], entryFile: string, dir: U } else { functions.push({ 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(), }); } }