0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

Prevent race condition in Vercel adapter on Node 18 (#11783)

This commit is contained in:
Matthew Phillips 2024-08-19 15:45:02 -04:00 committed by GitHub
parent ee7c757b6b
commit 7e8b188f4f

View file

@ -8,14 +8,15 @@ import {
ASTRO_PATH_PARAM,
} from './adapter.js';
// Run polyfills immediately so any dependent code can use the globals
applyPolyfills();
// 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(() => {});
applyPolyfills();
export const createExports = (
manifest: SSRManifest,
{ middlewareSecret, skewProtection }: { middlewareSecret: string; skewProtection: boolean },