You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[html] "Cannot redeclare block-scoped variable" in script type module #169117
bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitieshtmlHTML support issues
changed the title [-]Cannot redeclare block-scoped variable in script type module[/-][+]"Cannot redeclare block-scoped variable" in script type module[/+]on Dec 14, 2022
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.74.0. Please try upgrading to the latest version and checking whether this issue remains.
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.74.0. Please try upgrading to the latest version and checking whether this issue remains.
changed the title [-]"Cannot redeclare block-scoped variable" in script type module[/-][+][html] "Cannot redeclare block-scoped variable" in script type module[/+]on Dec 14, 2022
bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitieshtmlHTML support issues
Activity
[-]Cannot redeclare block-scoped variable in script type module[/-][+]"Cannot redeclare block-scoped variable" in script type module[/+]vscodenpa commentedon Dec 14, 2022
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.74.0. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
marlun78 commentedon Dec 14, 2022
Yes, it is still a valid issue.
[-]"Cannot redeclare block-scoped variable" in script type module[/-][+][html] "Cannot redeclare block-scoped variable" in script type module[/+]Eghizio commentedon Jul 15, 2024
Would be lovely if this would have been taken care of.
Or at least show us how we could fix/patch it locally 🙏
Resolve merge error for microsoft#169117
Squashed commit of the following:
twx0504 commentedon Oct 30, 2025
HI, this issue is still present. May I know if there's any update or fix we can do?
aeschli commentedon Oct 31, 2025
Help is always welcome. The code is at
vscode/extensions/html-language-features/server/src/modes/embeddedSupport.ts
Line 164 in f37adab
We create a document that only consist of the JavaScript parts. Likely we need to add
{/}for each script part of type module.