-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: Children snippet with argument is required to be explicitly defined now #12414
Comments
This #12400 is the culprit...will try to fix later. |
dummdidumm
added a commit
that referenced
this issue
Jul 12, 2024
The previous validation for checking if slots with let directives were rendered with `{@render children(...)}` had false positives - threw an error even if the other side didn't make use of the arguments, i.e. wasn't actually using a let directive - didn't check that the rendered snippet actually was the children property This fixes the validation by only applying it to children render tags, and by adding the slot to `$$slots.default` instead of `$$props.children` in more cases (when it's using `<svelte:fragment>` or `let:` directives, which both mean you're using old slot syntax) Fixes #12414
5 tasks
Rich-Harris
pushed a commit
that referenced
this issue
Jul 12, 2024
The previous validation for checking if slots with let directives were rendered with `{@render children(...)}` had false positives - threw an error even if the other side didn't make use of the arguments, i.e. wasn't actually using a let directive - didn't check that the rendered snippet actually was the children property This fixes the validation by only applying it to children render tags, and by adding the slot to `$$slots.default` instead of `$$props.children` in more cases (when it's using `<svelte:fragment>` or `let:` directives, which both mean you're using old slot syntax) Fixes #12414
wow, you guys are fast. Thanks. |
trueadm
pushed a commit
that referenced
this issue
Jul 16, 2024
The previous validation for checking if slots with let directives were rendered with `{@render children(...)}` had false positives - threw an error even if the other side didn't make use of the arguments, i.e. wasn't actually using a let directive - didn't check that the rendered snippet actually was the children property This fixes the validation by only applying it to children render tags, and by adding the slot to `$$slots.default` instead of `$$props.children` in more cases (when it's using `<svelte:fragment>` or `let:` directives, which both mean you're using old slot syntax) Fixes #12414
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
After upgrading from next.162 to next.182 children snippets are required to be explicitly defined if they receive an argument, even if the argument is not needed. I have a component set built upon bits-ui and use the
asChild
/builder
pattern for some components. in 162 it worked fine, the 15% of components that need to use the builder can use the explicit syntax, while the other 85% were able to be used as implicit children. now that results in arender_tag_invalid_argument
error.Reproduction
https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACp2STU_CQBCG_8q4mlBiS_WKBTUSEy540MSD9dBsB9jYzm52B9Q0_e9mKR8FJSEe5_uZmbcSU1WgE_23SlBWouiLe2NEKPjbeMMtsWAUoXB6YaX3JE5aZXiYUsqqNNoyvCqeP5MyBhmmVpeQil7ccvaaLqm48UUFMki9IIYBXDjOGIOrro9QytMFSVaaQJG0WCJx0IXKR1Juai4HcL1qU6eUxDsWSs6iCD61_VA0gwjwyxRKKg7BokS19N7MziCKhiklLbjVItW5W_PLuSpyixT4RdYp3bohGMMEMcccqlZwFatit7WS-KD7cTTS_F-8HdNIE6_AYJRxdiLN5OmlRaRKT8RHpv81ZL-tCEWpczVVmIs-2wXW4VZOrbzTZAUgNblGSRtVDaDj58KjV9eYCC086NJoQmIINm_qbPVVbe5Ue5EZq40LvMb2FZOrZXPeO4uUo91e97Z3-P4kbpJ_b_pe_wC9giVqRAMAAA==
Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: