Skip to content

invalid_snippet_arguments error but can't find the snippet #15771

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

Open
Omicrxn opened this issue Apr 15, 2025 · 2 comments
Open

invalid_snippet_arguments error but can't find the snippet #15771

Omicrxn opened this issue Apr 15, 2025 · 2 comments

Comments

@Omicrxn
Copy link

Omicrxn commented Apr 15, 2025

Describe the bug

Description:

After upgrading Svelte from an earlier version I'm encountering the invalid_snippet_arguments error in code that previously worked without issues. I suspect this may be related to #15521, but I'm not entirely sure. Getting the error on 5.25.3, and now 5.27.0. To give more insight, in the inspector the error points to a $state() variable that is not being passed to any snippet at all and inspecting it the variable is updating just fine. If i debug by triggering inspector breakpoints on error caught/uncaught, I get traced to an import of a svelte component that doesn't have nor is used in any snippet.

Problems:

The error message doesn't indicate which snippet is causing the problem.

This makes debugging extremely difficult, especially when the problematic snippet might or might not even be in my own code—it could be coming from a library.

Request:

Can you provide more information about what could be causing this error?

Is there a way to trace which snippet is failing?

Any guidance on how to approach fixing this—especially when third-party code might be involved—would be much appreciated.

Reproduction

Not sure as I can't find what snippet is at fault

Logs

Svelte error: invalid_snippet_arguments
A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`
https://svelte.dev/e/invalid_snippet_arguments

	in +page.svelte
	in +layout.svelte
	in +layout.svelte
	in root.svelte
        ....

System Info

System:
    OS: macOS 15.3.2
    CPU: (8) arm64 Apple M1
    Memory: 304.64 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.7.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.9.2 - /opt/homebrew/bin/npm
    pnpm: 10.8.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 135.0.7049.85
    Safari: 18.3.1

Severity

blocking all usage of svelte

@Ocean-OS
Copy link
Contributor

Ocean-OS commented Apr 16, 2025

Do you have a repository link you could send to show the project with the issue?

@Omicrxn
Copy link
Author

Omicrxn commented Apr 17, 2025

hey @Ocean-OS unfortunately no, but after a lot of debugging and code reviewing i found the snippet, however that wasn't the point of the issue, I opened it because of the error not showing which snippet is at fault thus making debugging more difficult.

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

No branches or pull requests

2 participants