We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
fails with an error like
Error while migrating Svelte code [InternalCompileError: Unexpected token `}`. Did you mean `}` or `{"}"}`?] {
when typescript code contains casting using angle-brackets. (<>)
in typescript code use angle-brackets casting:
const variable = <string>somevar;
If you instead cast using the as keyword, it works as expected:
as
const variable = somevar as string;
No response
sv 0.6.6 System: OS: macOS 14.7.1 CPU: (14) arm64 Apple M3 Max Memory: 104.59 MB / 36.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.9.0 - /usr/local/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 10.9.2 - /opt/homebrew/bin/npm pnpm: 9.12.2 - ~/Library/pnpm/pnpm Browsers: Chrome: 131.0.6778.108 Edge: 131.0.2903.70 Safari: 18.1.1
annoyance
The text was updated successfully, but these errors were encountered:
This is a known issue with acorn typescript...thanks for reporting tho!
closing as duplicate of #13179
Sorry, something went wrong.
No branches or pull requests
Describe the bug
sv migrate svelte-5
fails with an error like
when typescript code contains casting using angle-brackets. (<>)
Reproduction
in typescript code use angle-brackets casting:
If you instead cast using the
as
keyword, it works as expected:Logs
No response
System Info
sv 0.6.6 System: OS: macOS 14.7.1 CPU: (14) arm64 Apple M3 Max Memory: 104.59 MB / 36.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.9.0 - /usr/local/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 10.9.2 - /opt/homebrew/bin/npm pnpm: 9.12.2 - ~/Library/pnpm/pnpm Browsers: Chrome: 131.0.6778.108 Edge: 131.0.2903.70 Safari: 18.1.1
Severity
annoyance
The text was updated successfully, but these errors were encountered: