From 59694fed4b972052fdf438037df1ef5205cc521d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gautier=20Ben=20A=C3=AFm?= <48261497+GauBen@users.noreply.github.com> Date: Sat, 15 Jan 2022 18:39:24 +0100 Subject: [PATCH] [fix] make properties overwritable (#3356) (#3357) --- .changeset/cyan-schools-kiss.md | 5 +++++ packages/kit/src/install-fetch.js | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/cyan-schools-kiss.md diff --git a/.changeset/cyan-schools-kiss.md b/.changeset/cyan-schools-kiss.md new file mode 100644 index 000000000000..da3cd06d3dfd --- /dev/null +++ b/.changeset/cyan-schools-kiss.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +Allow \_\_fetch_polyfill() to run several times diff --git a/packages/kit/src/install-fetch.js b/packages/kit/src/install-fetch.js index 629e38884996..aee7971d76c5 100644 --- a/packages/kit/src/install-fetch.js +++ b/packages/kit/src/install-fetch.js @@ -5,18 +5,22 @@ export function __fetch_polyfill() { Object.defineProperties(globalThis, { fetch: { enumerable: true, + configurable: true, value: fetch }, Response: { enumerable: true, + configurable: true, value: Response }, Request: { enumerable: true, + configurable: true, value: Request }, Headers: { enumerable: true, + configurable: true, value: Headers } });