diff --git a/.changeset/spicy-parrots-beam.md b/.changeset/spicy-parrots-beam.md new file mode 100644 index 000000000..9cd38b278 --- /dev/null +++ b/.changeset/spicy-parrots-beam.md @@ -0,0 +1,5 @@ +--- +'@astrojs/netlify': patch +--- + +Fix issue with prerendered pages when using `edge-functions` adapter diff --git a/packages/integrations/netlify/src/integration-edge-functions.ts b/packages/integrations/netlify/src/integration-edge-functions.ts index a05f8f3a0..2ba619865 100644 --- a/packages/integrations/netlify/src/integration-edge-functions.ts +++ b/packages/integrations/netlify/src/integration-edge-functions.ts @@ -117,18 +117,6 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {}) name: '@astrojs/netlify/edge-functions', hooks: { 'astro:config:setup': ({ config, updateConfig }) => { - // Add a plugin that shims the global environment. - const injectPlugin: VitePlugin = { - name: '@astrojs/netlify/plugin-inject', - generateBundle(_options, bundle) { - if (_buildConfig.serverEntry in bundle) { - const chunk = bundle[_buildConfig.serverEntry]; - if (chunk && chunk.type === 'chunk') { - chunk.code = `globalThis.process = { argv: [], env: {}, };${chunk.code}`; - } - } - }, - }; const outDir = dist ?? new URL('./dist/', config.root); updateConfig({ outDir, @@ -137,9 +125,6 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {}) server: new URL('./.netlify/edge-functions/', config.root), serverEntry: 'entry.js', }, - vite: { - plugins: [injectPlugin], - }, }); }, 'astro:config:done': ({ config, setAdapter }) => {