-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
feature / enhancementNew feature or requestNew feature or request
Milestone
Description
Describe the problem
I have seen multiple instances of json being used to try and return data from a form action.
This seems like a fairly easy mistake to make and the error is not all that helpful.
Cannot stringify arbitrary non-POJOs
Describe the proposed solution
Check if the object returned from a form action is an instance of Response and give a more specific error if that is the case.
Not sure about the exact wording. Was thinking about referencing that a "plain object" should be returned, but devalue can serialize some not so plain objects as well. Maybe the message could contain a very simple example as well.
Form actions need to return objects directly and cannot wrap them in a
Response.
E.g.return { success: true };
Alternatives considered
-
Importance
nice to have
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature / enhancementNew feature or requestNew feature or request