JsonpMainTemplatePlugin ‘Promise’ is undefined IE11

Webpack version:
2.1.0-beta.15

Please tell us about your environment:
Windows 10

Current behavior:
I’m experiencing the following uncaught exception when running aurelia’s skeleton-esnext-webpack
capture

The issue appears to originate from the bundled version of webpack\lib\JsonpMainTemplatePlugin.js

I’m not sure if this is an bug with webpack or a misconfiguration with the webpack.config that is being used for the project.

Expected/desired behavior:
Promise API is polyfilled correctly.

Browser: IE 11

Language: ES6/7 (Babel)

Author: Fantashit

2 thoughts on “JsonpMainTemplatePlugin ‘Promise’ is undefined IE11

  1. @mhingston I’ve got the same issue.
    I solved that by “polyfilling” manually before using require.ensure. It’s a workaround.
    Take a look:

    if (window.Map && Map.prototype.keys && Object.keys && Object.assign)
    	initApp()
    else {
    	if (!window.Promise)
    		window.Promise = require('es6-promise')
    	require.ensure([ 'babel-polyfill' ], function() {
    		require('babel-polyfill')
    		initApp()
    	})
    }

    That way, Promise will be available when webpack’s ensure method try to use it.
    Is your call decide which Promise library you’ll use to polyfill.

  2. Having the same problem where webpack assumes Promise as a globally available object, which fails on ie 11. Can this issue be re-opened?

Comments are closed.