Closed
Description
Hi all, I'm using this template with Vue v2 RC5, Vuex and VuexFire (Firebase).
When I run the dev server and try it in IE11, I get the following error in the browser console: SCRIPT5022: [vuex] vuex requires a Promise polyfill in this browser.
I'm not sure why this is the case as I'd assume all JS is compiled to ES5 code...?
Please advise, thanks in advance.
Activity
yyx990803 commentedon Sep 13, 2016
ES6 -> ES5 transpilation only handles syntax transformation, not polyfills (these are more like runtime features). You can either use
babel-polyfill
(which includes all ES6 related polyfills) or justes6-promise
.niallobrien commentedon Sep 14, 2016
Thanks for clarifying @yyx990803 👍
DevanB commentedon Nov 30, 2016
Is there any documentation of the process to add the polyfill @yyx990803? I've checked the Webpack template docs, but didn't find anything. My webpack skills aren't strong.
yyx990803 commentedon Nov 30, 2016
@DevanB polyfills are not webpack specific https://github.com/stefanpenner/es6-promise
DevanB commentedon Nov 30, 2016
Forgive me, as I'm new to dealing with this scenario. In es6-promise's documentation here, it looks as though I can simply add this:
require('es6-promise').polyfill();
to a file. Would it be ideal to add that code in mymain.js
where Vue is being instantiated, or should something like this go inwebpack.prod.conf.js
file?Thanks for the help @yyx990803. I know you are super busy!
yyx990803 commentedon Nov 30, 2016
I'd add that to the top of your entry file
DevanB commentedon Nov 30, 2016
Found one half of my problem. I was using the Prerender SPA plugin, which seems to be having the same problems: chrisvfritz/prerender-spa-plugin#16.
After pulling that out and trying both
babel-polyfill
(and it's instructions) andes6-promise
(and it's instructions), I was not able to get the promise polyfill to work on IE10 and below. I hope this makes it on the radar as an issue to at least research into. I will be glad to appropriately document the problem and steps I've taken to resolve it some where, if this isn't the correct place for the discussion.Thanks @yyx990803 for the help!
atilacamurca commentedon Dec 7, 2016
Using Babel polyfill solved the problem. Here are the steps what I did:
npm install --save-dev babel-polyfill
then include the polyfill file before your source and test files within the
files
section of yourtest/unit/karma.conf.js
Source: http://stackoverflow.com/a/40784617/1152679
niallobrien commentedon Dec 8, 2016
Thanks for sharing @atilacamurca 👍
inouetakuya commentedon Jan 2, 2017
In addtion to #260 (comment) if you use
es6-promise
:(version of es6-promise:
4.0.5
)2 remaining items