Release brokes IE 11

shlima
0
shlima
commented 4 months ago

Version

v5.2.1

Reproduction link

http://ie11.com

Steps to reproduce

nuxt-i18n v5.12.5 adds the is-https dependency, which code is not transpiled properly.

IE 11 fails in the following line here: (default function arg xForwardedProto = true)

function isHTTPS(req, xForwardedProto = true) {
...
}

With the following error:

SCRIPT1006: Expected ')'

What is expected ?

Works

What is actually happening?

Not working

bug
0
paulgv
4.9k
paulgv
commented 4 months ago

@rchl WDYT? Could you have a look?

0
rchl
373
rchl
commented 4 months ago

It does indeed look like default arguments are not transpiled in nuxt. Compiled bundle has this code:

t.exports = function(t, e = !0) {

@pi0 Do you have any take on this? Is Nuxt supposed to support IE11?

0
rchl
373
rchl
commented 4 months ago

BTW. Given that it's not even needed on the client, we could work around that by conditionally requiring it but then I would need to mix require and es6 imports which I'm not sure is a good idea…

0
shlima
0
shlima
commented 4 months ago

@pi0 Do you have any take on this? Is Nuxt supposed to support IE11?

Nuxt, vue and nuxt-i18n worked perfect in IE 11 before

0
rchl
373
rchl
commented 4 months ago

Then I wonder why is Nuxt not transpiling that construct…

0
rchl
373
rchl
commented 4 months ago

I will require it conditionally for now which will fix that problem (and as a bonus, make client bundle tiny bit smaller). I would be vary of mixing require and es imports but since middleware.js already does that for ./utils, I guess it should work (for now at least).

0
paulgv
4.9k
paulgv
commented 4 months ago

Sounds good, thanks @rchl

0
Informations
Bug ReportOpen
#c250 - Created 4 months ago