From 7b0af08a7f3b4f63fc6e285f8c24325e64561817 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Fri, 20 Sep 2024 14:47:52 +0100 Subject: [PATCH] fix(container): apply polyfill --- .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();