sveltekit-superforms icon indicating copy to clipboard operation
sveltekit-superforms copied to clipboard

TypeScript errors on errors store in UI for discriminated unions with nested data

Open JanKillburger-PH opened this issue 3 weeks ago • 0 comments

  • [x] Before posting an issue, read the FAQ and search the previous issues. I haven't found anything related to this.

Description This is related to discriminated unions that contain object values among the discriminated properties. The runtime behavior is totally fine but I am getting TypeScript errors in the +page.svelte file when using the errors object in my HTML markup that the nested properties don't exist on the errors object. With the form object everything is fine, so I assume the issue is related to how the errors types are derived.

If applicable, a MRE I have modified the discriminated-union example to reproduce the issue: https://www.sveltelab.dev/ml216d801cl50x6 Again, the runtime behavior is perfect. I receive the error and it is displayed in the UI. But the TypeScript errors in the +page.svelte persist.

JanKillburger-PH avatar Nov 05 '25 13:11 JanKillburger-PH