Search code examples
internet-explorervue.jspromiserequirees6-promise

Internet Explorer Vuejs require polyfill Promise


I really got no experience with Vuejs and now I have to fix a code for Internet Explorer. the First problem was, to fix all arrow Functions - nothing special, I did it.

The second one is I dont get any Content on the Website only in Internet Explorer - its working on Edge, Chrome etc....
I really have no clue what to do i searched and tried everything, like npm installing require, babel-polyfill, promise, etc...

I hope someone can Help me here with Exact instruction what to do. you can see the code on http://gebrauchtwagen.itpm.at/mvc2/index.html

Thank You


Solution

  • You'll probably want to use es6-promise - it works out-of-the-box with webpack (I'll assume that's what you're using because that's what most primers on Vue recommend).

    All you need to do is install it with npm or yarn (instructions in the github repo), and then require it in your project:

    import 'es6-promise/auto';
    

    Later edit: saw you're just importing Vue from a CDN, so in your case, just import the Promise polyfill the same way:

    <script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script> 
    

    (instructions also in the repo)