Open fnimick opened 7 months ago
I don't know if its related but I'm having an issue where the form is validated locally, but since form data is sent as strings, the validation on the server fails because "123" is not a number
I don't know if its related but I'm having an issue where the form is validated locally, but since form data is sent as strings, the validation on the server fails because "123" is not a number
This is unrelated and an issue with your schema, you need to coerce it into a number.
Regarding the actual issue, I'll try to investigate and see why this is happening.
Describe the bug
For some reason, using the same
form
object directly withFormPrimitive.Field
from formsnap correctly narrows the type for thevalue
prop, but using it withForm.Field
from shadcn does not.This works:
(value is now the correct type of of the field from the form definition)
This does not:
(value is
unknown
)Reproduction
https://stackblitz.com/edit/github-dsnve4?file=src%2Froutes%2F%2Bpage.svelte,src%2Froutes%2F%2Bpage.server.ts
It doesn't show inline, but run
npm run check
and the error will appear for the<Form.Field>
case.Logs
No response
System Info
Severity
annoyance