Open
Description
- Before posting an issue, read the FAQ at https://superforms.rocks/faq and search the previous issues.
Description
When used with a recursive zod schema, FormPathLeaves
fails with an error such as:
Type of property 'ingredients' circularly references itself in mapped type '{ [K in keyof NonNullable<Ingredient>]-?: K extends string ? NonNullable<NonNullable<Ingredient>[K]> extends object ? `${K}${NonNullable<...> extends unknown[] ? "" : "."}${StringPathLeaves<...> & string}` : never : never; }'
This prevents the use of componentized fields with a form validated with a recursive schema as shown in https://superforms.rocks/components.
If applicable, a MRE
https://stackblitz.com/edit/sveltekit-superforms-1-testing-whrq5p?file=src%2Froutes%2Fschema.ts
Observe the error on the reified type ExampleFormPathLeaves
. This error occurs wherever FormPathLeaves
is used on the form type resulting from validating this schema.