hooks.ts for server and client, but simple redirect not working unless I use hooks.server.ts #13637
Replies: 2 comments
-
You should use For further details, check out the SvelteKit Redirects documentation. |
Beta Was this translation helpful? Give feedback.
-
Hi @rielzzapps, The Check the hooks docs and redirects docs for more details. Hope that clears it up! |
Beta Was this translation helpful? Give feedback.
-
I start a simple test application on sveltekit, and I add this hooks.ts file:
My expectations, because of hooks.ts, is that when I go to /test I just see the svelte welcome page.
But it gives the 404.
When I change it to hooks.server.ts, it works as expected. I try to understand why. Hooks.ts should be for server- and client-side code?
Beta Was this translation helpful? Give feedback.
All reactions