Skip to content

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

Closed
@ota-meshi

Description

@ota-meshi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions