You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the {@render} directive within a <svelte:head> tag results in a "Svelte error: invalid_snippet_arguments".
This issue started occurring with version svelte@5.26.0. The code was working in previous versions.
Reproduction
Run npx sv create my-app
Replace the contents of src/routes/+page.svelte with the following:
Svelte error: invalid_snippet_arguments
A snippet functionwas passed invalid arguments. Snippets should only be instantiated via `{@render ...}`
https://svelte.dev/e/invalid_snippet_arguments
at invalid_snippet_arguments (eval at runInlinedModule (file:///C:/Users/NextLegacy/Desktop/New%20folder/my-app/node_modules/vite/dist/node/module-runner.js:1049:11), <anonymous>:29:17)
at Module.validate_snippet_args (eval at runInlinedModule (file:///C:/Users/NextLegacy/Desktop/New%20folder/my-app/node_modules/vite/dist/node/module-runner.js:1049:11), <anonymous>:114:54)
at abc (eval at runInlinedModule (file:///C:/Users/NextLegacy/Desktop/New%20folder/my-app/node_modules/vite/dist/node/module-runner.js:1049:11), <anonymous>:11:24)
at eval (eval at runInlinedModule (file:///C:/Users/NextLegacy/Desktop/New%20folder/my-app/node_modules/vite/dist/node/module-runner.js:1049:11), <anonymous>:23:3)
at Module.head (eval at runInlinedModule (file:///C:/Users/NextLegacy/Desktop/New%20folder/my-app/node_modules/vite/dist/node/module-runner.js:1049:11), <anonymous>:130:2)
at _page (eval at runInlinedModule (file:///C:/Users/NextLegacy/Desktop/New%20folder/my-app/node_modules/vite/dist/node/module-runner.js:1049:11), <anonymous>:21:24)
at children (eval at runInlinedModule (file:///C:/Users/NextLegacy/Desktop/New%20folder/my-app/node_modules/vite/dist/node/module-runner.js:1049:11), <anonymous>:66:5)
at _layout (eval at runInlinedModule (file:///C:/Users/NextLegacy/Desktop/New%20folder/my-app/node_modules/vite/dist/node/module-runner.js:1049:11), <anonymous>:19:2)
at Root (eval at runInlinedModule (file:///C:/Users/NextLegacy/Desktop/New%20folder/my-app/node_modules/vite/dist/node/module-runner.js:1049:11), <anonymous>:61:3)
at render (eval at runInlinedModule (file:///C:/Users/NextLegacy/Desktop/New%20folder/my-app/node_modules/vite/dist/node/module-runner.js:1049:11), <anonymous>:94:2)
The issue is that the validate snippet function on the server is checking for instance of Payload but inside the head we pass Payload.head which is just an object
Describe the bug
Using the {@render} directive within a
<svelte:head>
tag results in a"Svelte error: invalid_snippet_arguments"
.This issue started occurring with version
svelte@5.26.0
. The code was working in previous versions.Reproduction
npx sv create my-app
src/routes/+page.svelte
with the following:npm install && npm run dev
Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: