mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-05-19 05:03:23 +08:00
Guard polyfills against window possibly being undefined (#7205)
This commit is contained in:
2
packages/react-app-polyfill/ie11.js
vendored
2
packages/react-app-polyfill/ie11.js
vendored
@@ -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
|
||||
|
||||
3
packages/react-app-polyfill/ie9.js
vendored
3
packages/react-app-polyfill/ie9.js
vendored
@@ -11,4 +11,5 @@ require('./ie11');
|
||||
// React 16+ relies on Map, Set, and requestAnimationFrame
|
||||
require('core-js/features/map');
|
||||
require('core-js/features/set');
|
||||
require('raf').polyfill(window);
|
||||
|
||||
require('raf').polyfill();
|
||||
|
||||
Reference in New Issue
Block a user