0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Fix no edge functions deployed to netlify (#6793)

This commit is contained in:
André Alves 2023-04-10 05:50:54 -03:00 committed by GitHub
parent 84a4648884
commit 1e3873c04a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/netlify': patch
---
fix: no edge functions deployed to netlify

View file

@ -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',
},
});
},

View file

@ -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');