From 27694c7be78b049aefb52f3264fe6a4b592b9ed3 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Wed, 12 Apr 2017 08:17:56 +0300 Subject: [PATCH] #316: fix Edge fails with fetch --- src/polyfills.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/polyfills.js b/src/polyfills.js index a7d9aa2..f794c99 100644 --- a/src/polyfills.js +++ b/src/polyfills.js @@ -8,10 +8,12 @@ if (isEdge) { // https://github.com/aurelia/fetch-client/issues/81 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9370062/ // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7773267/ - window.fetch = undefined; + Reflect.deleteProperty(window, 'fetch'); } -import 'whatwg-fetch'; +// using require instead of import, because import is hoisting to the top +// so that our fetch hack for Edge won't work +require('whatwg-fetch'); shimPromiseFinaly();