Skip to content

Commit 62fcb2b

Browse files
arunodaimpronunciable
authored andcommitted
Add a global Promise polyfill. (vercel#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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy