Skip to content

Svelte 5: Parse error in comment in template interpolation #12494

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
ota-meshi opened this issue Jul 18, 2024 · 2 comments
Closed

Svelte 5: Parse error in comment in template interpolation #12494

ota-meshi opened this issue Jul 18, 2024 · 2 comments

Comments

@ota-meshi
Copy link
Member

Describe the bug

he following code seems to result in a parsing error when using svelte 5.0.0-next.190.
However, if I remove the comments the parsing works fine.

<script>
function foo () {
	return "42"
}
</script>
{foo(/*comment*/)}

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAEz3LQQrCMBBG4auEf2VLoSCuShE8h-NC0gkEmpmQTAUJubt04_J98BpC3LlieTbIOzEWPHLGBPvmM-qHd2NMqHoUf8pafYnZ7iThEG9RxQVVdxlcIyErbEcRR7hdCSSdZJ3_Rwuql3n0mhKLjfPQSUgwIekWQ-QNi5WD-6v_ANmR8l2YAAAA

Logs

Error compiling App.svelte:
Expected token }

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M3
    Memory: 134.83 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.4.1 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.1 - /usr/local/bin/npm
    pnpm: 9.4.0 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 126.0.6478.182
    Chrome Canary: 121.0.6124.0
    Safari: 17.4.1
  npmPackages:
    svelte: 5.0.0-next.190 => 5.0.0-next.190

Severity

blocking an upgrade

@ota-meshi
Copy link
Member Author

From what I've checked, using 5.0.0-next.184 seems to be fine, but I think the same problem will occur with 5.0.0-next.185.

@dummdidumm
Copy link
Member

Fixed by #12471

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

No branches or pull requests

2 participants