{"record":{"id":"6edfa2330073398a","repo":"sveltejs/svelte","slug":"invalid-default-snippet","errorCode":"invalid_default_snippet","errorMessage":"invalid_default_snippet\nCannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead\nhttps://svelte.dev/e/invalid_default_snippet","messagePattern":"invalid_default_snippet\nCannot use `(.+?)` if the parent component uses `let:` directives\\. Consider using a named snippet instead\nhttps://svelte\\.dev/e/invalid_default_snippet","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/svelte/src/internal/shared/errors.js","lineNumber":34,"sourceCode":"\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/experimental_async_required`);\n\t}\n}\n\n/**\n * Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead\n * @returns {never}\n */\nexport function invalid_default_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_default_snippet\\nCannot use \\`{@render children(...)}\\` if the parent component uses \\`let:\\` directives. Consider using a named snippet instead\\nhttps://svelte.dev/e/invalid_default_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_default_snippet`);\n\t}\n}\n\n/**\n * A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`\n * @returns {never}\n */\nexport function invalid_snippet_arguments() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet_arguments\\nA snippet function was passed invalid arguments. Snippets should only be instantiated via \\`{@render ...}\\`\\nhttps://svelte.dev/e/invalid_snippet_arguments`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet_arguments`);\n\t}\n}","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/sveltejs/svelte/blob/20b341f10048cf1016a2028ac7eee5595cfef6a5/packages/svelte/src/internal/shared/errors.js#L16-L52","documentation":"In Svelte 5, the implicit `children` snippet cannot be rendered with `{@render children(...)}` when the parent component also uses `let:` directives. The legacy `let:` slot-prop pattern conflicts with the named-snippet model, so Svelte requires an explicitly named snippet instead. Thrown at runtime in DEV.","triggerScenarios":"A parent passes content via `let:` (slot props) while the child renders `{@render children(...)}` — mixing the legacy `let:` directive with snippet rendering in the same component relationship.","commonSituations":"Migrating Svelte 4 slot components to Svelte 5 snippets piecemeal; a child that uses `{@render children()}` while a parent still uses `<Child let:data={data}>`.","solutions":["Replace `let:` directives with a named snippet: define `{#snippet named(data)}` and render with `{@render named(...)}`.","Migrate the parent fully off `let:` — pass data via regular props.","Keep the slot-to-snippet migration atomic per component so `let:` and `children` render never coexist."],"exampleFix":"<!-- before -->\n<!-- Parent.svelte -->\n<List items={xs} let:item>{item.name}</List>\n<!-- List.svelte -->\n{@render children(...)}\n<!-- after -->\n<!-- Parent.svelte -->\n<List items={xs}>{#snippet row(item)}{item.name}{/snippet}</List>\n<!-- List.svelte -->\n{@render row(...)}","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never mix `let:` directives with `{@render children()}` in the same parent/child relationship.","Migrate `let:` slot props to named snippets (`{#snippet}`) in Svelte 5.","Keep slot-to-snippet migration atomic per component.","Pass data via regular props when you no longer need slot semantics."],"tags":["snippets","children","let-directive","slots","svelte5","migration"],"backgroundTag":null,"analyzedSha":"20b341f10048cf1016a2028ac7eee5595cfef6a5","analyzedAt":"2026-08-12T23:37:30.399Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}