Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0.1 is not compatible with IE11 #28

Closed
simonbrent opened this issue May 10, 2021 · 5 comments
Closed

4.0.1 is not compatible with IE11 #28

simonbrent opened this issue May 10, 2021 · 5 comments

Comments

@simonbrent
Copy link

I'm not sure whether this bug report belongs here, or in the Nuxt repo, or in the @nuxtjs/axios repo...

With the latest version of Nuxt (2.15.5) and @nuxtjs/axios (5.13.1), an error is thrown when visiting a page in IE11, because defu is included in _nuxt/vendors/app.js, with the following code present (from node_modules/defu/dist/defu.mjs):

function _defu(baseObj, defaults, namespace = ".", merger) {
...

To reproduce:

@pi0
Copy link
Member

pi0 commented May 12, 2021

Hi. Thanks for notice but yes progressively dropping IE11 is happening in different tools to get prepared for nuxt3. You can add defu to build.transpile:

export default {
   build: {
    transpile: ['defu']
   }
}

@simonbrent
Copy link
Author

That is indeed the fix I came up with, but given that nuxt 2 DOES support IE11, I would not expect to have to transpile dependencies of nuxt/nuxt plugins/modules etc. - I would expect them to work without that.

@pi0
Copy link
Member

pi0 commented May 17, 2021

Hi @simonbrent. I've checked nuxt core. Default app is not depending on defu but axios module is and it was an unwanted breaking change for breaking IE11 support. Updating @nuxtjs/axios to ^5.13.3+ should fix issue. If didn't fixed, make sure to also recreate lockfile.

@simonbrent
Copy link
Author

@pi0 Thanks a lot, that fixed it.

@rodrigopv
Copy link

On my side, I had to put axios back to "5.13.1" on package.json. I've been 3 hours now looking why our frontend broke, and it seems that using "^5.12.5" was enough to make axios load defu as a CommonJS dependency, thus breaking webpack (where es6 imports can't be mixed with module.exports).

I'm no expert on webpack nor defu, so if someone relates to what I'm explaining, this is the way I managed to fix a Nuxt deployment where the following error happened:

Cannot assign to read only property 'exports' of object '#<Object>'
on line:
module.exports = defu;

Couldn't understand what was happening as since many major versions that defu doesn't use module.exports anymore, but transpile might be the reason that brings this bug back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants