Commit 62fcb2b6 authored by Arunoda Susiripala's avatar Arunoda Susiripala Committed by Dan Zajdband

Add a global Promise polyfill. (#1344)

* Add a global Promise polyfill.
This is because Webpack2 depends on it.

* Change the polyfill location.
parent 888a029c
......@@ -7,6 +7,15 @@ import App from '../lib/app'
import evalScript from '../lib/eval-script'
import { loadGetInitialProps, getURL } from '../lib/utils'
// Polyfill Promise globally
// This is needed because Webpack2's dynamic loading(common chunks) code
// depends on Promise.
// So, we need to polyfill it.
// See: https://github.com/webpack/webpack/issues/4254
if (!window.Promise) {
window.Promise = Promise
}
const {
__NEXT_DATA__: {
component,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment