ActionForm cannot handle error returned by server function #1878
Unanswered
SleeplessOne1917
asked this question in
Q&A
Replies: 1 comment 11 replies
-
When it works in the Ok state, is it reloading the page or sending a request from the browser to the server function endpoint? If it's reloading the page, I expect there's some kind of hydration issue. Unless you're in islands mode in which case it's a different situation. That would also explain the form posting to the server fn endpoint and then sitting there. It's hard to say anything more useful without any way to reproduce it. |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following:
When the server function returns an

Ok
, everything works as intended. When it returns anErr
, I get the following:There are a couple of things to notice here. First, the browser's URL bar is set to the URL of the server function. Second is that I have created a RW signal to take in the error value for
ActionForm
and have passed it as a prop. The third is that I have a derived signal to track when there is an error that I use for aShow
component in theActionForm
.I have tried putting a suspense and an error boundary around the action form to no avail. I've also tried making a small representative example repo of the issue, but was unable to replicate it. I'm guessing this means that the problem is with my code instead of how
ActionForm
s handle errors returned by their action.Has anyone encountered a similar problem?
Beta Was this translation helpful? Give feedback.
All reactions