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

Svelte 5: <svelte:self /> can't be directly added to a {#snippet} #9436

Closed
robertadamsonsmith opened this issue Nov 14, 2023 · 0 comments · Fixed by #9439
Closed

Svelte 5: <svelte:self /> can't be directly added to a {#snippet} #9436

robertadamsonsmith opened this issue Nov 14, 2023 · 0 comments · Fixed by #9439

Comments

@robertadamsonsmith
Copy link

Describe the bug

Adding <svelte:self /> directly to a {#snippet}, raises the error:

<svelte:self> components can only exist inside {#if} blocks, {#each} blocks, or slots passed to components

I would have expected it to be allowed though. Adding an {#if true} block to the snippet effectively silences the error, allowing the expected behaviour.

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACn2SMW-DMBCF_8qVdEikIJKONEXt2L2dSgdiH40Vc7Z8pmmE-O89Q6SkSxfEw_fefQ8YstZY5Kz8GDJqOszK7MX7bJ3Fs0-Cv9FGFM2uDyo92bEKxseqpjpajDAo11OEJ9huRrne--A8L1ePNe2K6yjNY2O63d3lOdT0Tsp1HVI09AXxgNA6a90pKeU0rkGSdK-Q5dAwYAgulOKekUpG21Yy2XlHEsKgGgJH9gz4YziCITYaYViYdoS9derIa1HYqMNVuwBsnZh9w4waortJrCnPqxlX-BdMxnsp_IYcH5ZTnVXqE2-JLq9jhEKcQ3HxjJeoS_fXOMHuEbpGEGXpyYVj0o3Wqb8cztyn0Ig_wOT-i3BLkIYhhh4n9Q-RjBaS-xctJYt__o4VbObI54CkZfV1V75dTc4pQH6JzmnTGtRZOa3-HH8BvP-Y000CAAA=

Logs

No response

System Info

https://svelte-5-preview.vercel.app/

Severity

annoyance

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