Skip to content

Svelte 5: Identifier <x> has already been declared #11416

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

Closed
rChaoz opened this issue May 1, 2024 · 2 comments
Closed

Svelte 5: Identifier <x> has already been declared #11416

rChaoz opened this issue May 1, 2024 · 2 comments

Comments

@rChaoz
Copy link
Contributor

rChaoz commented May 1, 2024

Describe the bug

In TypeScript, it is common to have variables and types with the same name. Svelte 5 native TypeScript support prohibits this, breaking existing TypeScript code.

Reproduction

let Something = 5

interface Something {}

REPL

Logs

Error: Identifier 'Something' has already been declared (svelte)

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700KF
    Memory: 13.10 GB / 31.86 GB
  Binaries:
    Node: 20.8.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.1.1 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.2.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0)
    Internet Explorer: 11.0.19041.1566

Severity

annoyance

@rChaoz
Copy link
Contributor Author

rChaoz commented May 1, 2024

Probably related to #11412

@rChaoz rChaoz changed the title Svelte 5: Identified <x> has already been declared Svelte 5: Identifier <x> has already been declared May 1, 2024
@trueadm trueadm self-assigned this May 2, 2024
@trueadm trueadm added this to the 5.0 milestone May 2, 2024
@Rich-Harris
Copy link
Member

This is an issue in acorn-typescript: TyrealHu/acorn-typescript#50

@trueadm trueadm removed their assignment May 8, 2024
@trueadm trueadm modified the milestones: 5.0, 5.x Jun 3, 2024
@dummdidumm dummdidumm marked this as a duplicate of #13188 Feb 26, 2025
@dummdidumm dummdidumm marked this as a duplicate of #13125 Feb 26, 2025
@dummdidumm dummdidumm marked this as not a duplicate of #13188 Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants