Axios-module: defu not support IE 11

Created on 18 Dec 2019  路  12Comments  路  Source: nuxt-community/axios-module

Version

v5.9.0

Reproduction link

https://google.com

Steps to reproduce

update this from v5.8.0.

What is expected ?

IE 11 can not use.

What is actually happening?

IE 11 can not use.

Additional comments?

https://github.com/jsless/defu/issues/2

This bug report is available on Nuxt community (#c309)
bug-report

All 12 comments

me too
but i think
consola package version

when @nuxtjs/axios version 5.8.0
consola is 2.10.1

but @nuxtjs/axios version 5.9.1
consola is 2.11.1

@nuxtjs/axios downgrade is ok..

check consola version please.

me too

Version
v5.9.0

Steps to reproduce
update this from v5.8.0.

What is expected ?
<= Android 5.1.1 can not use.

What is actually happening?
<= Android 5.1.1 can not use.

Additional comments?
jsless/defu#2

me too
I degrade to v5.6.0锛宼hat doesnot depend on defu

cc @pi0

Should be fixed with [email protected] : https://github.com/jsless/defu/commit/5a6de7cc7391bbd26116ab3501c6c03276b70288

But with yarn it doesn't seem to be possible to get it even with lock file maintenance ...

image

0.0.4 is installable, and even if manually changing resolved version in maintenance file, it keeps installing back 0.0.3 :man_shrugging:

Better should upgrade the axios module defu dependency to 0.0.4 to fix the issue.

/cc @pi0

Arrow function issue resolved and axios v5.9.1 released with updated dependency. I'm just worried about typeof usage. Can one please double confirm it is now working fine with IE? Otherwise we need to put defu in transpile.

@pi0
test with below version and add transpile defu on nuxt.config.js
it's work on IE 11.

nuxt 2.11.0
@nuxtjs/axios 5.9.1
defu 0.0.4

Thanks.

@joey91133 Would you please test without transpile? If there is an error, also would you please share it?

@pi0
It's work without transpile on IE 11.

Since defu 0.0.4 it's the opposite for me. IE 11 complains from syntax error.

I found this didn't work either transpiled or not, after upgrading axios. I got round it for IE11 by using patch-module to patch defu. Here's the patch in case it's useful to anyone who stumbles across this thread until it's fixed fully.

diff --git a/node_modules/defu/lib/index.js b/node_modules/defu/lib/index.js
index 5258622..202c7f4 100644
--- a/node_modules/defu/lib/index.js
+++ b/node_modules/defu/lib/index.js
@@ -13,7 +13,7 @@ function defu (_obj, _defaults) {

   const obj = Object.assign({}, _defaults)

-  for (const key in _obj) {
+  for (let key in _obj) {
     if (key === '__proto__' || key === 'constructor') {
       continue
     }

@edwh I think you are using an outdated version of defu. Latest version(s) do not use for:

https://unpkg.com/[email protected]/lib/index.js

Best would be to remove lock file and create it again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mclighter picture mclighter  路  3Comments

cawa-93 picture cawa-93  路  4Comments

ruudboon picture ruudboon  路  5Comments

altafsayani picture altafsayani  路  3Comments

seanwash picture seanwash  路  6Comments