Redirect in production:
I have this simple action:
in development, this works fine, but in production, it doesn't work. any idea why this might be happening?
9 Replies
What has showed in the console?
Succes, its with plain node
how about clear the cache and cookie before run the app?
I already tried that, if I compile and test in node locally the same thing happens, it registers my event but the redirect does nothing, the server responds 200
Can I have a look at the code of component that you want to redirect to?
sure:
I have similar issue last week. My solution is set up a cache which handles with the session in the router.load() at first, and create a resource by using createAsync to check whether the session works fine. In the Code as following:
getPost()
is the function cached:
I hope it is useful.dam this working.... but its strange....... why in develop this work xD
It's still not clear to me. maybe the documents should include something about it @ryansolid 🤔
thx @hannus
I think the reason is single data flow, so make sure the data that used in the component is a signal. Cache is a plus for enhancing performance.
in the LoginForm() component, throw redirect based on a normal async function(handleSession). I believe that would be call once and hard to execute at the time you want.