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
This seems to be only a problem whenever you are using form actions with multiple named actions.
If you have multiple actions that return different objects, you will get "Property 'x' does not exist on type" errors from typescript.
This is a bit annoying since you then have to define your own types instead of using SvelteKit generated types.
The text was updated successfully, but these errors were encountered:
madupuis90
changed the title
Make ActionData type generation an aggregation of all possible return types
ActionData generated type missing some properties in the template because of the way it does union
Feb 3, 2023
Describe the bug
This seems to be only a problem whenever you are using form actions with multiple named actions.
If you have multiple actions that return different objects, you will get "Property 'x' does not exist on type" errors from typescript.
This is a bit annoying since you then have to define your own types instead of using SvelteKit generated types.
(I'm not sure if this is a bug or intended)
Related ?:
Reproduction
https://github.com/madupuis90/form-actions-type-github
This is the simply a create svelte app using the form action examples from the docs (with implemented register function instead of commented)
If you look in +page.svelte you will see the invalid types. Commenting the
register
action clears the errors.Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: