-
Notifications
You must be signed in to change notification settings - Fork 518
Add Promise polyfill for IE #386
Comments
Can't you just add it yourself if you need to support IE? Bluebird is a good one. |
That's a valid point, but the same could be said for #365, right? IMO, it seems incorrect that the |
I agree with @antmdvs that it would make sense that this should work out of the box. If the template is broken for IE11, it raises the question of what else was overlooked. |
I don't mind having to add a promise library but guidance to what to update with webpack would be good. I have added in the webpack.config.vendor.js
And in my boot.ts:
But still get SCRIPT5009: 'Promise' is undefined Thanks |
@beatsm Have you found a solution for this? I'm also looking to add the promise polyfill to the ReactRedux template. Any help would be appreciated. |
I was able to include babel-polfill to fix this issue in IE11. I included "babel-polyfill" in package.json. Here is the boot-client.tsx:
The polyfill added to webpack.config.vendor.js:
Not sure if this is the best way to go about it, however. |
@Singularity222 No, sorry I still have not found a way to get this to work. I am using the Aurelia template and in a work environment where IE is the most prevalent browser. This makes me sad :-( |
If anybody is interested. For the Aurelia template I had to patch the aurelia-bootstrapper-webpack.js with the following:
This is loaded before the app giving me the headache. Not sure this is the recommended way but can't link to a CDN in my environment and don't want to copy the node_modules to wwwroot. @EisenbergEffect - Is this normal or have I done something stupid? |
@niieani is probably the best person to comment. I should also note that we have some new webpack updates coming that will add full HMR :) And then server rendering is coming soon too :) Yay! |
@beatsm the best way to globally polyfill Promise is to add this plugin to your Webpack config:
This will replace all calls to If you want to additionally expose a global
You'll need to It's the equivalent of your: if (!window.Promise) {
window.Promise = Promise;
} |
@niieani Thanks for taking the time. Have you actually tried this? If you have, then I must be doing something wrong. I added that into the webpack.config.js which didn't work. I then added it to the webpack.config.vendor.js, still no joy and then tried adding it to both. At this point I just hacked the aurelia-bootstrapper-webpack.js as it seems to executes before anything else and doesn't take the plugin into account. Regards |
@niieani - Got it to work in the webpack.config.js using the plugin, I was just doing it wrong. |
Glad to hear @beatsm. |
Glad you got that aspect of it working. Thanks for letting us know! As for the original matter of Promise polyfill, I'll close this in favour of #484 which describes it more generally. |
The
fetchdata
route blows up with the following error in IE if there is no Promise polyfill:http://caniuse.com/#search=promise
The text was updated successfully, but these errors were encountered: