Merdot
Throw redirects in data APIs with "use server" at the top of the file not working.
I think I incorrectly explained it, I'll fix the initial post, I mean when I put the "use server"; at the top of the file, the redirect does not occur but when I put in in the function itself the redirect occurs.
I notice that on the client, the /_server route is called with some headers that point to the wrapped function, but that call does not return a redirect but a 200.
ie.
Redirect works in SSR and on client interactions but bundle all my private function and it dependencies in the cliente, I don't want that code to land on the client.
Redirect do not work on SSR and client interaction call /_server and return a
200
no private code is bundled.
I imagine now that I think more of this, that because I'm marking the entire module as server, the query itself also is being executed in the server when is intended to occur on the client. How do I do redirect in code I want only to run on the server without bundling dependencies of that code to the client.
If throw redirects in the route.load/preload functions the system just crash.5 replies