Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard polyfills against window possibly being undefined #7205

Merged
merged 3 commits into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-app-polyfill/ie11.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion packages/react-app-polyfill/ie9.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ require('./ie11');
// React 16+ relies on Map, Set, and requestAnimationFrame
require('core-js/features/map');
ianschmitz marked this conversation as resolved.
Show resolved Hide resolved
require('core-js/features/set');
require('raf').polyfill(window);

require('raf').polyfill();