Subscribe on changes!

"SyntaxError: Cannot declare a let variable twice: 'e'" when using vue.global.prod.js in Safari 10 (iOS 10)

avatar
Oct 23rd 2020

Version

3.0.2

Reproduction link

https://codepen.io/horseluke/pen/LYZxGrv

Steps to reproduce

  1. Create blank html file, include vue.global.prod.js by using script tag
  2. Run it in Safari 10 (iOS 10)
  3. Create another blank html file, but this time include vue.global.js by using script tag
  4. Run it in Safari 10 (iOS 10)

What is expected?

Both step 2 and step 4 are work as all.

What is actually happening?

Step 2 run failed. It will throw "SyntaxError: Cannot declare a let variable twice: 'e'. vue@3.0.2/vue.global.prod.js:1:0"

Step 4 works OK.


There is a bug on Safari 10 (iOS 10). In Vue 3.x, Minified js file will trigger this problem.

More detail and References can be found here:

https://github.com/online-go/online-go.com/issues/758

https://bugs.webkit.org/show_bug.cgi?id=171041

avatar
Oct 23rd 2020

Thanks although I'm not sure there is much we can do here apart from manually patching the generated file and publishing a new patch. A better fix would be to change the minifier behavior

avatar
Nov 9th 2020

@posva after apply patch https://github.com/vuejs/vue-next/pull/2472 and rebuild from master branch, this issue resolved. Thanks!