From 99e9bdd9bdbe35e0aa043f23174ba11d8694f84c Mon Sep 17 00:00:00 2001 From: Jake Moxey Date: Thu, 13 Jun 2019 09:42:15 +1000 Subject: [PATCH 1/3] Guard ie9 polyfill against window possibly being undefined --- packages/react-app-polyfill/ie9.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-app-polyfill/ie9.js b/packages/react-app-polyfill/ie9.js index 42e31fdb1f..e0529fc702 100644 --- a/packages/react-app-polyfill/ie9.js +++ b/packages/react-app-polyfill/ie9.js @@ -11,4 +11,7 @@ require('./ie11'); // React 16+ relies on Map, Set, and requestAnimationFrame require('core-js/features/map'); require('core-js/features/set'); -require('raf').polyfill(window); + +if (typeof window !== 'undefined') { + require('raf').polyfill(window); +} From 13da0fc1c1238e894b81889e5009af3ae791b581 Mon Sep 17 00:00:00 2001 From: Jake Moxey Date: Wed, 14 Aug 2019 14:56:46 +1000 Subject: [PATCH 2/3] Update ie9.js --- packages/react-app-polyfill/ie9.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/react-app-polyfill/ie9.js b/packages/react-app-polyfill/ie9.js index e0529fc702..13e2f9b6a2 100644 --- a/packages/react-app-polyfill/ie9.js +++ b/packages/react-app-polyfill/ie9.js @@ -12,6 +12,4 @@ require('./ie11'); require('core-js/features/map'); require('core-js/features/set'); -if (typeof window !== 'undefined') { - require('raf').polyfill(window); -} +require('raf').polyfill(); From 94414ac1656dd6d78ff16ba1cacff72642d6ac8c Mon Sep 17 00:00:00 2001 From: Jake Moxey Date: Wed, 14 Aug 2019 14:57:41 +1000 Subject: [PATCH 3/3] Update ie11.js --- packages/react-app-polyfill/ie11.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-app-polyfill/ie11.js b/packages/react-app-polyfill/ie11.js index 4a5bcd6bf3..b61390923f 100644 --- a/packages/react-app-polyfill/ie11.js +++ b/packages/react-app-polyfill/ie11.js @@ -11,7 +11,7 @@ if (typeof Promise === 'undefined') { // inconsistent state due to an error, but it gets swallowed by a Promise, // and the user has no idea what causes React's erratic future behavior. require('promise/lib/rejection-tracking').enable(); - window.Promise = require('promise/lib/es6-extensions.js'); + self.Promise = require('promise/lib/es6-extensions.js'); } // Make sure we're in a Browser-like environment before importing polyfills