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

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

Closed
HorseLuke opened this issue Oct 23, 2020 · 2 comments · Fixed by #2472
Labels
browser specific has PR A pull request has already been submitted to solve the issue

Comments

@HorseLuke
Copy link

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:

online-go/online-go.com#758

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

@posva
Copy link
Member

posva commented Oct 23, 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

Justineo added a commit to Justineo/vue-next that referenced this issue Oct 23, 2020
@LinusBorg LinusBorg added browser specific has PR A pull request has already been submitted to solve the issue labels Oct 23, 2020
@HorseLuke
Copy link
Author

HorseLuke commented Nov 9, 2020

@posva after apply patch #2472 and rebuild from master branch, this issue resolved. Thanks!

@posva posva reopened this Nov 13, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
browser specific has PR A pull request has already been submitted to solve the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants