From 97e7248cc7c0ae4833914e37e7d2e1f86fe5500e Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 12 Sep 2022 11:18:49 -0400 Subject: [PATCH 1/2] fix: serialize route pattern for Netlify edge Co-authored-by: Jackie Macharia --- .../integrations/netlify/src/integration-edge-functions.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(), }); } } From 486ba0e7796dedd30844da2591f63a9aae1ff209 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 12 Sep 2022 11:25:07 -0400 Subject: [PATCH 2/2] chore: changeset --- .changeset/dull-flowers-prove.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/dull-flowers-prove.md 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