Skip to content

ReferenceError when assigning a snippet #15812

@buhrmi

Description

@buhrmi

Describe the bug

When assigning a snippet that contains dynamic content to a variable, and then attempting to @render the snippet, it will give a ReferenceError.

In the provided reproduction, you can see that it work with static content (setContent1 button), but errors out with dynamic content (setContent2 button).

Reproduction

https://svelte.dev/playground/c3bbe052fdfc4e87a46ccd9091ee002b?version=5.20.5#H4sIAAAAAAAAE4WRTWvDMAyG_4rRLi2MluQY2m6jDHbeDjssO6SOAmaeY2xlHxj_91mpS7rSrQeD_eR9ZEUOYJp3hAoesUOHRuK9c72Da-iURg_VSwD6tpxgkHjO31m78B-oidmu8XiOy94QGkplYOWlU5Y2takpYU-C8IvEWtTwgFr34rl3uq2Bv_PSSCLrfOwGI0n1Rnik7R4Xs7kIY5xyMFXLu4J5_EMs_xHLLK6WU79m1SnUbSqw4d5ylUqE2zSwFt3BvVnM5qM6xVneDUTp_t5IreTbOhz9QRzHcQTY3ucvueWpW5644cobZe00xmLsTognakhJsT0MNyxzMJ7VyqwFfq_4O56emClU5AaMr-nUKP2pTAtV12iP8Qc7As4gXwIAAA==

Logs

System Info

n/a

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions