Skip to content
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

Astro actions not validate fields without client side #11681

Closed
1 task
gtrabanco opened this issue Aug 12, 2024 · 1 comment
Closed
1 task

Astro actions not validate fields without client side #11681

gtrabanco opened this issue Aug 12, 2024 · 1 comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: actions Related to Astro actions (scope)

Comments

@gtrabanco
Copy link

Astro Info

Astro                    v4.13.3
Node                     v20.16.0
System                   macOS (arm64)
Package Manager          bun
Output                   hybrid
Adapter                  @astrojs/vercel/serverless
Integrations             @astrojs/sitemap
                         @astrojs/react

If this issue only occurs in one browser, which browser is a problem?

Not relevant

Describe the Bug

Astro zod validations are not happening. Input fields error when using astro actions with pure html solution without client side code are not retrieved as RFC explains by using Astro.getActionResult and isInputError.

Also when I use custom client side by using native html I can not see any field error if I sent a less length than minimum (for example). So I need to do all validations by my own because no error is retrieved when fields does not respect the declared zod Schema.

What's the expected result?

I expect that input stuff as zod Scheme return error in fields as rfc explains but I got no error in inputs. I can not also retrieve custom error for fields (I mean I can not use ActionInputError) and I have to return generic errors or do my own validation/impletation for this.

Not sure if this is the expected behaviour.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-r9u7nb-deyhwl?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Aug 12, 2024
@Princesseuh Princesseuh added - P3: minor bug An edge case that only affects very specific usage (priority) feat: actions Related to Astro actions (scope) and removed needs triage Issue needs to be triaged labels Aug 14, 2024
@gtrabanco
Copy link
Author

This is solved in Astro v4.13.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: actions Related to Astro actions (scope)
Projects
None yet
Development

No branches or pull requests

2 participants