svelte
SvelteKit navigation function misuse
goto.*not available.*server|redirect.*must be thrown
Fixes
- 1.Use throw redirect(303, '/path') in server load functions instead of goto()
- 2.goto() is client-only — use it in event handlers or onMount, not in load()
- 3.Import redirect from @sveltejs/kit for server-side redirects
sveltesveltekitnavigation
Related Errors
svelte3 fixes
Component not valid for SSR rendering
is not a valid SSR component
- •Add export default to the component or check the import path
- •Ensure the component doesn't use browser APIs at top level
svelte3 fixes
Svelte $ reactive syntax error
\$.*is not defined|\$state.*not allowed
- •Ensure $ reactive declarations are at the top level of a .svelte file
- •In Svelte 5, use $state() rune inside .svelte.ts files only with proper config
svelte3 fixes
Lifecycle function called outside component initialization
lifecycle.*can only be.*during.*initialisation|onMount.*outside component
- •Call onMount/onDestroy at the top level of the component script, not in callbacks
- •Move lifecycle calls out of async functions or setTimeout