diff --git a/.changeset/many-rivers-hide.md b/.changeset/many-rivers-hide.md new file mode 100644 index 000000000000..57b131f6203b --- /dev/null +++ b/.changeset/many-rivers-hide.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +Only apply polyfills where necessary diff --git a/packages/kit/src/exports/node/polyfills.js b/packages/kit/src/exports/node/polyfills.js index ba0e49ef8d85..390ab511382a 100644 --- a/packages/kit/src/exports/node/polyfills.js +++ b/packages/kit/src/exports/node/polyfills.js @@ -18,6 +18,8 @@ const globals = { // exported for dev/preview and node environments export function installPolyfills() { for (const name in globals) { + if (name in globalThis) continue; + Object.defineProperty(globalThis, name, { enumerable: true, configurable: true,