From 100cce705d04d1627d2aff401a71c09e402a150e Mon Sep 17 00:00:00 2001 From: Jackie Macharia Date: Thu, 18 Aug 2022 13:38:54 +0300 Subject: [PATCH] fix: serialize route patterns as per validation pattern --- .../integrations/netlify/src/integration-edge-functions.ts | 4 +++- 1 file changed, 3 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..225d234f76fe 100644 --- a/packages/integrations/netlify/src/integration-edge-functions.ts +++ b/packages/integrations/netlify/src/integration-edge-functions.ts @@ -53,7 +53,9 @@ async function createEdgeManifest(routes: RouteData[], entryFile: string, dir: U } else { functions.push({ function: entryFile, - pattern: route.pattern.toString(), + // serialize pattern, expected format: ^/work/([^/]+?)/([^/]+?)/?$ + // https://github.com/netlify/edge-bundler/blob/main/src/manifest.ts#L34 + pattern: route.pattern.source.replace(/\\\//g, '/').toString(), }); } }