From 243ecb6d6146dc483b4726d0e76142fb25e56243 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Fri, 20 Sep 2024 18:09:37 +0100 Subject: [PATCH] fix(container): apply polyfill (#12042) --- .changeset/fast-queens-try.md | 5 +++++ packages/astro/src/container/index.ts | 1 + packages/astro/src/container/polyfill.ts | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 .changeset/fast-queens-try.md create mode 100644 packages/astro/src/container/polyfill.ts diff --git a/.changeset/fast-queens-try.md b/.changeset/fast-queens-try.md new file mode 100644 index 000000000000..b062639c1f91 --- /dev/null +++ b/.changeset/fast-queens-try.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a problem in the Container API, where a polyfill wasn't correctly applied. This caused an issue in some environments where `crypto` isn't supported. diff --git a/packages/astro/src/container/index.ts b/packages/astro/src/container/index.ts index f0c600a40623..fef82df2a382 100644 --- a/packages/astro/src/container/index.ts +++ b/packages/astro/src/container/index.ts @@ -1,3 +1,4 @@ +import './polyfill.js'; import { posix } from 'node:path'; import type { AstroConfig, diff --git a/packages/astro/src/container/polyfill.ts b/packages/astro/src/container/polyfill.ts new file mode 100644 index 000000000000..baf53359686c --- /dev/null +++ b/packages/astro/src/container/polyfill.ts @@ -0,0 +1,3 @@ +import { applyPolyfills } from '../core/app/node.js'; + +applyPolyfills();