diff --git a/.changeset/strong-hairs-sort.md b/.changeset/strong-hairs-sort.md new file mode 100644 index 000000000000..518a013e508f --- /dev/null +++ b/.changeset/strong-hairs-sort.md @@ -0,0 +1,5 @@ +--- +'@astrojs/netlify': patch +--- + +fix: no edge functions deployed to netlify diff --git a/packages/integrations/netlify/src/integration-edge-functions.ts b/packages/integrations/netlify/src/integration-edge-functions.ts index 495501f6806f..b11710430f9d 100644 --- a/packages/integrations/netlify/src/integration-edge-functions.ts +++ b/packages/integrations/netlify/src/integration-edge-functions.ts @@ -122,7 +122,8 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {}) build: { client: outDir, server: new URL('./.netlify/edge-functions/', config.root), - serverEntry: 'entry.mjs', + // Netlify expects .js and will always interpret as ESM + serverEntry: 'entry.js', }, }); }, diff --git a/packages/integrations/netlify/test/edge-functions/prerender.test.ts b/packages/integrations/netlify/test/edge-functions/prerender.test.ts index 976c50b5f000..1a272b101449 100644 --- a/packages/integrations/netlify/test/edge-functions/prerender.test.ts +++ b/packages/integrations/netlify/test/edge-functions/prerender.test.ts @@ -9,7 +9,7 @@ Deno.test({ async fn() { let close = await runBuild('./fixtures/prerender/'); const { default: handler } = await import( - './fixtures/prerender/.netlify/edge-functions/entry.mjs' + './fixtures/prerender/.netlify/edge-functions/entry.js' ); const response = await handler(new Request('http://example.com/index.html')); assertEquals(response, undefined, 'No response because this is an asset');