You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astro v4.13.1
Node v22.4.0
System macOS (arm64)
Package Manager unknown
Output server
Adapter @astrojs/node
Integrations @clerk/astro/integration
@astrojs/react
@astrojs/tailwind
astro:db
@astrojs/db/file-url
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I have a FormSchema, that I use for the client and on the server. The input for a server action doesn't return a default value where I was expecting it. I discovered this because I wanted to pass in an array of Files to upload to a bucket but the server kept saying that my input for images is invalid.
So I did a little investigation and found the part that would fix my use case and opened a PR. I've since taken it down so I'm raising this issue instead.
Ultimately, what I wanted was a list of Files from the client in the server action and it was throwing an error because the .default() method was not being handled.
Thanks for reporting this @billy-le! Yes, it looks like default values on form inputs aren't handled correctly. I checked that PR you linked, and I'm honestly happy to reopen and leave a few review comments before merging. Would you be open to that?
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I have a FormSchema, that I use for the client and on the server. The input for a server action doesn't return a default value where I was expecting it. I discovered this because I wanted to pass in an array of Files to upload to a bucket but the server kept saying that my input for
images
is invalid.So I did a little investigation and found the part that would fix my use case and opened a PR. I've since taken it down so I'm raising this issue instead.
Ultimately, what I wanted was a list of Files from the client in the server action and it was throwing an error because the
.default()
method was not being handled.What's the expected result?
I expected this input to handle this correctly:
z.array(z.instanceof(File)).default([])
to return an empty array or a list of Files.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-7qnawk?file=src%2Fcomponents%2FPropertyForm.tsx
Couldn't reproduce on stackblitz. Seems like I can't perform server actions on there.
Participation
The text was updated successfully, but these errors were encountered: