-
-
Notifications
You must be signed in to change notification settings - Fork 695
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
ActionForms get stuck on page of server function when JS and WASM disabled #1891
Comments
This is working as designed. As I understand it, the expected behavior you describe in the case of an I'm open to suggestions on how to make this better, of course; for example, we could adopt some kind of default pattern in which an Alternatively, you can handle it by redirecting (using |
I tried that and I still have the same problem. It may be because I am still returning an
Yes with the exception of what I emphasized in the quote. I expect the error would be handled during SSR.
I see. While I can understand wanting to return the correct status code to the browser, I would think that the errors should be handled in either in an error boundary defined by the user or inside the component with the form using the Judging by your first suggestion, it seems that serializing the error in a way that can be used without JS/WASM is necessary for this sort of behavior. I wonder if the error information could be omitted from the URL entirely and just have the most recent serialized response be handled before the page is returned to the user? |
It's possible to create a version that does post to an SSRed page, and I explored that a little in #1120 but there are some limitations there.
I'm sorry, I don't think I understand what this means on a practical/technical level. My impression is that on each of these points the core issue is that
|
Maybe server actions could implicitly send the route they're being called from when submitted by an |
Hm. Yes so the headers do already include the URL of the page it's called from, which is why it manages to redirect successfully back to that page on Including it in the URL for the redirect is messy but possible. I wonder if there's actually a way to include a header, and have it passed through to the new request. i.e., to redirect back from the server function we send a
No worries at all! It's fuzzy in my head too, and I wish it worked a little better! |
If one uses I was struggling to understand what's happening when I could only get error responses back as plain text from the let value = server_fn_called.value(); and trying to capture errors with ev.prevent_default() event handler either (components in islands mode only render html?) and the expected result is normal html form behavior - as in - off you go request and server responds as it pleases (In my case 500 / error text / no redirect) , right? By the way if I try to add my |
Yes, right!
Yeah, sorry for the pain there. Glad you found your way to this issue for the explanation; your understanding is correct.
I think in the latest version (0.5.2) |
Added in #2158. |
Describe the bug
After some more testing on the issue I ran into for #1878, I am 95% certain that I discovered a bug.
Leptos Dependencies
Better than a list of dependencies, I made a minimal reproducible example.
To Reproduce
Steps to reproduce the behavior:
cargo leptos watch
for the included exampleExpected behavior
I get redirected back to the page where I submitted the form.
The text was updated successfully, but these errors were encountered: