sveltejs/svelte · error · Error
snippet_without_render_tag
snippet_without_render_tag
Error message
snippet_without_render_tag
Attempted to render a snippet without a `{@render}` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change `{snippet}` to `{@render snippet()}`.
https://svelte.dev/e/snippet_without_render_tag What it means
In Svelte 5, referencing a snippet as `{snippet}` in markup (instead of `{@render snippet()}`) would stringify the snippet function rather than render its content. Svelte detects this in DEV and instructs you to change `{snippet}` to `{@render snippet()}`, preventing a silent `[object Function]` render.
Source
Thrown at packages/svelte/src/internal/shared/errors.js:116
throw error;
} else {
throw new Error(`https://svelte.dev/e/missing_context`);
}
}
/**
* Attempted to render a snippet without a `{@render}` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change `{snippet}` to `{@render snippet()}`.
* @returns {never}
*/
export function snippet_without_render_tag() {
if (DEV) {
const error = new Error(`snippet_without_render_tag\nAttempted to render a snippet without a \`{@render}\` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change \`{snippet}\` to \`{@render snippet()}\`.\nhttps://svelte.dev/e/snippet_without_render_tag`);
error.name = 'Svelte error';
throw error;
} else {
throw new Error(`https://svelte.dev/e/snippet_without_render_tag`);
}
}
/**
* `%name%` is not a store with a `subscribe` method
* @param {string} name
* @returns {never}
*/
export function store_invalid_shape(name) {
if (DEV) {
const error = new Error(`store_invalid_shape\n\`${name}\` is not a store with a \`subscribe\` method\nhttps://svelte.dev/e/store_invalid_shape`);
error.name = 'Svelte error';
throw error;
} else {
throw new Error(`https://svelte.dev/e/store_invalid_shape`);
}View on GitHub (pinned to 20b341f100)
Solutions
- Change `{snippet}` to `{@render snippet()}`.
- If the snippet takes arguments, render them: `{@render snippet(arg)}`.
Example fix
<!-- before -->
{children}
<!-- after -->
{@render children()} Defensive patterns
Strategy: validation
Prevention
- Always render snippets with `{@render snippet()}`.
- Run the Svelte compiler/lint to catch bare snippet references.
- When migrating `<slot/>`, replace it with `{@render children()}`.
- Treat snippets as render-only — never as reactive template values.
When it happens
Trigger: Writing `{children}` instead of `{@render children()}` in a template; passing a snippet and rendering it bare; migrating from Svelte 4 `<slot/>` and forgetting the `@render` tag.
Common situations: Migrating from Svelte 4 `<slot/>` to snippets; forgetting the `@render` tag; treating snippets like reactive values.
Related errors
- This migration would change the name of a slot (${slot_name}
- This migration would change the name of a slot (${name} to $
- invalid_default_snippet
- invalid_snippet_arguments
- 'svelte/compiler' no longer exports a `walk` utility — pleas
AI-assisted analysis of sveltejs/svelte@20b341f100 (2026-08-12).
Data as JSON: /api/errors/8a3dcd14d6ca0724.
Report an issue: GitHub.