Skip to content

Commit 62fcb2b

Browse files
arunodaimpronunciable
authored andcommitted
Add a global Promise polyfill. (#1344)
* Add a global Promise polyfill. This is because Webpack2 depends on it. * Change the polyfill location.
1 parent 888a029 commit 62fcb2b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

client/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ import App from '../lib/app'
77
import evalScript from '../lib/eval-script'
88
import { loadGetInitialProps, getURL } from '../lib/utils'
99

10+
// Polyfill Promise globally
11+
// This is needed because Webpack2's dynamic loading(common chunks) code
12+
// depends on Promise.
13+
// So, we need to polyfill it.
14+
// See: https://github.com/webpack/webpack/issues/4254
15+
if (!window.Promise) {
16+
window.Promise = Promise
17+
}
18+
1019
const {
1120
__NEXT_DATA__: {
1221
component,

0 commit comments

Comments
 (0)