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

sv migrate svelte-5 uses Typescript syntax in bare <script> tags #14219

Closed
twm opened this issue Nov 8, 2024 · 0 comments · Fixed by #14222
Closed

sv migrate svelte-5 uses Typescript syntax in bare <script> tags #14219

twm opened this issue Nov 8, 2024 · 0 comments · Fixed by #14222

Comments

@twm
Copy link

twm commented Nov 8, 2024

Describe the bug

I ran npx sv migrate svelte-5 and found that it injected Typescript syntax (interface) into bare <script> tags, resulting in errors like this:

.../halo/src/routes/+layout.svelte:8:23
Error: Type annotations can only be used in TypeScript files. (js)

    let { children }: Props = $props()
</script>

I was able to resolve this by adding lang="ts" to the <script> tags.

Reproduction

Run npx sv migrate svelte-5 on twm/halo@e26f3e6

When I did so I got [email protected]

Logs

No response

System Info

I ran this command but the output was garbage — it thought there was a container (nope!) and failed to identify the installed browsers correctly. I'm on Ubuntu 24.04 x86-64.

Severity

annoyance

paoloricciuti pushed a commit that referenced this issue Nov 8, 2024
* fix: add `lang="ts"` attribute during migration if needed

fixes #14219

* fix
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

Successfully merging a pull request may close this issue.

1 participant