summaryrefslogtreecommitdiff
path: root/packages/integrations/netlify/src/ssr-function.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/netlify/src/ssr-function.ts')
-rw-r--r--packages/integrations/netlify/src/ssr-function.ts13
1 files changed, 5 insertions, 8 deletions
diff --git a/packages/integrations/netlify/src/ssr-function.ts b/packages/integrations/netlify/src/ssr-function.ts
index 22925ddaa..5ea2e97f1 100644
--- a/packages/integrations/netlify/src/ssr-function.ts
+++ b/packages/integrations/netlify/src/ssr-function.ts
@@ -1,15 +1,12 @@
+// Keep at the top
+import './polyfill.js';
+
import type { Context } from '@netlify/functions';
import type { SSRManifest } from 'astro';
import { App } from 'astro/app';
-import { applyPolyfills } from 'astro/app/node';
-
-applyPolyfills();
+import { setGetEnv } from 'astro/env/setup';
-// Won't throw if the virtual module is not available because it's not supported in
-// the users's astro version or if astro:env is not enabled in the project
-await import('astro/env/setup')
- .then((mod) => mod.setGetEnv((key) => process.env[key]))
- .catch(() => {});
+setGetEnv((key) => process.env[key]);
export interface Args {
middlewareSecret: string;