-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
Docs: Note $ACTION_
formData properties
#63048
Conversation
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
WorkaroundIn future, these properties with the In the meantime, instead of // TODO: Revert to `Object.fromEntries(formData.entries())` if `$ACTION_`
// properties are omitted from Next.js dev mode Server Actions formData in future
// https://github.com/vercel/next.js/pull/63048#issuecomment-1986138940
Object.fromEntries(
[...formData.entries()].filter(([key]) => !key.startsWith('$ACTION_')),
) |
@karlhorky Taking a look! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for submitting a
Thanks for the review and merge @samcx 🙌 |
What?
Make a note about the new
$ACTION_
properties in theformData
Why?
Since
next@14.1.3
, some new$ACTION_
properties have appeared in theformData
in development mode, which cause validation errors when used with a strict validation with a library such as Zod or Yup:The errors from Yup:
The data in the
formData.entries()
How?
Document additional properties with keys starting with the prefix
$ACTION_
Alternatives Considered
Maybe these
$ACTION_
properties are not intended to be exposed to users, and should be stripped before theformData
reaches the Server Action.Related
The documentation was originally introduced in commit
687239c
, which was a part of this PR:cc @delbaoliveira