Open ethanfox opened 4 days ago
What is initialValues
? They are not used in superForm
, and that's not needed either as the Zod adapter handles default values.
The check for objects is only made when dataType is set to 'json', and as the "validators" field isn't part of your schema, I suspect you are passing the wrong object somewhere. If you try to make a MRE with the following link, I'm sure you'll find the problem somewhere. Otherwise, I'll take a closer look.
https://sveltelab.dev/github.com/ciscoheat/superforms-examples/tree/zod
Description I'm encountering a critical issue with
sveltekit-superforms
where none of the form fields are being recognized. Despite following the documentation and ensuring thatdataType: 'json'
is set anduse:enhance
is applied, the form initialization fails, and I receive errors indicating that all fields are missing from the form object. This issue affects all fields defined in the schema.Schema
Form Initialization
Steps to Reproduce
Expected Behavior The form should initialize correctly with the provided schema and initial values, allowing for client-side validation and submission handling without errors.
Actual Behavior Page doesnt load. Console log message:
Issues with handling nested data structures despite setting dataType: 'json'.
Additional Context SvelteKit version: 2.8.1 sveltekit-superforms version: 2.20.1 Browser: Chrome Operating System: MacOS 15.1