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

Minification using Microsoft Visual Studio 22 causes "Identifier has already been declared Error" #124

Closed
gallge01 opened this issue Dec 30, 2022 · 1 comment

Comments

@gallge01
Copy link

The issue only presented itself when minified and seems to be a scope related problem when defining variables in the else statement that are to be used outside the scope of the else statement. The actual response from the error provided precious little information other than the delaraction error pointing to this piece of the code.

== Issue
if (this["bootstrap-input-spinner"]) {
console.warn("element", this, "is already a bootstrap-input-spinner")
} else {
-- variables defined here were causing the issue
}

== Quick Fix
if (this["bootstrap-input-spinner"]) {
console.warn("element", this, "is already a bootstrap-input-spinner")
return;
}
-- Code continues here not contained within else statement without issue particularly when minified.

@shaack
Copy link
Owner

shaack commented Dec 30, 2022

If there is a bug in Visual Studio, it should be reported to Microsoft, I think.

@shaack shaack closed this as completed Jan 13, 2023
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

2 participants