Polyfill for ie

Jamie picture Jamie · Jan 6, 2017 · Viewed 8.9k times · Source

I'm trying to add a polyfill to my vue.js 2.0/Laravel5.3 application because in internet explorer 11 I receive an error:

vuex requires a Promise polyfill in this browser.

So I've followed the docs I'm using ecm 6 so I did:

npm install --save-dev babel-polyfill

And added this at the top in my bootstrap.js:

import "babel-polyfill";

But still the same error in Internet explorer. What should I do or what am I doing wrong here?

Answer

Rashad Saleh picture Rashad Saleh · Jan 6, 2017

If you are using Webpack, find your webpack.base.conf.js file (mine was in the build folder), or the equivalent webpack configuration file, then modify the app entry variable to include babel-polyfill at the start so it looks something like this:

entry: {
    app: ['babel-polyfill', ...]
  },
  .
  .
  .