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

const type paremeter svelte(js_parse_error) #14864

Open
max-kamps opened this issue Dec 30, 2024 · 0 comments
Open

const type paremeter svelte(js_parse_error) #14864

max-kamps opened this issue Dec 30, 2024 · 0 comments

Comments

@max-kamps
Copy link

max-kamps commented Dec 30, 2024

Describe the bug

const type parameters are a feature added in Typescript 5.0.
However, trying to use them in a .svelte or .svelte.ts file results in Unexpected keyword 'const' https://svelte.dev/e/js_parse_error

This is presumably a missing feature in acorn-typescript, and as such blocked by #13439

Reproduction

<script lang=ts>
  function test<const T>(value: T) {
    return value;
  }
</script>

<h1>Hello {test("World")}!</h1>

Logs

No response

System Info

System:
    OS: Linux 6.12 Arch Linux
    CPU: (16) x64 AMD Ryzen 7 7840U w/ Radeon  780M Graphics
    Memory: 17.86 GB / 30.66 GB
    Container: Yes
    Shell: 5.2.37 - /bin/bash
  Binaries:
    Node: 23.4.0 - ~/.nvm/versions/node/v23.4.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v23.4.0/bin/npm
  npmPackages:
    rollup: ^4.29.1 => 4.29.1

Severity

annoyance

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

2 participants