Nuxt.js: IE11 vuex requires a Promise polyfill

Created on 30 Mar 2017  路  8Comments  路  Source: nuxt/nuxt.js

I got this error when tried to open builded nuxt application in IE 11. I tried to implement babel-polyfill or es6-promise, but with no luck.

How to implement Promise polyfill for IE?

This question is available on Nuxt.js community (#c422)

Most helpful comment

Hi, @ezhkov!

I fix IE11 problems with babel-polyfill:
nuxt.config.js

build: {
    vendor: [
      'babel-polyfill'
    ]
}

don't forget to: npm install babel-polyfill

All 8 comments

How to properly include it in application?

Hi, @ezhkov!

I fix IE11 problems with babel-polyfill:
nuxt.config.js

build: {
    vendor: [
      'babel-polyfill'
    ]
}

don't forget to: npm install babel-polyfill

Sorry, don't sure if it resolve promise errors. I'm using it for Symbol.

Konstantin, great solution. Thanks.
I found another one

build: {
        extend(config, { isClient }) {
            if (isClient) {
                config.entry.vendor.push('babel-polyfill')
            }
        }
    }

I like yours much more )

Would it possible to do feature detection in nuxt and load a built vendor bundle with only the libraries needed?
like:

if (!window.fetch && !window.Promise) {
  //load vendor bundle with fetch and promise polyfill included
}
if (!window.Promise) {
  //load vendor bundle with only promise pollyfill included
}
//and so on

The vendor builds could be lighter. yepnope suggested this technique in their deprecation notice.

This could be extended to not load any js at all if not supported: BBC coined the term Cutting the mustard.

I think this would be a great option to extend the already great progressive enhancement functionality of nuxt.

Hi, @laterne! I think it's could be a good feature request, but probably you should create a new issue.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bimohxh picture bimohxh  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

msudgh picture msudgh  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

uptownhr picture uptownhr  路  3Comments