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
There'll be a type check error when the Component type definition extends SvelteCopmonentTyped<{}, {}, {}> in strict mode. Not sure if we should count it as a bug because it's possible to avoid it in the userland.
The error is
Argument of type 'typeof Component' is not assignable to parameter of type 'ConstructorOfATypedSvelteComponent'.
Types of construct signatures are incompatible.
Type 'new (options: IComponentOptions<{}>) => Component' is not assignable to type 'new (args: { target: any; props?: any; }) => ATypedSvelteComponent'.
Construct signature return types 'Component' and 'ATypedSvelteComponent' are incompatible.
The types of '$on' are incompatible between these types.
Type '<K extends never>(type: K, callback: (e: {}[K]) => void) => () => void' is not assignable to type '(event: string, handler: ((e: any) => any) | null | undefined) => () => void'.
Types of parameters 'callback' and 'handler' are incompatible.
Type '((e: any) => any) | null | undefined' is not assignable to type '(e: never) => void'.
Type 'undefined' is not assignable to type '(e: never) => void'.
...
I can't reproduce only with earlier versions of Svelte that had the | undefined | null missing. I'm not sure what we can do about this except say "bump your Svelte version".
Yeah. Indeed it doesn't happen in the latest svelte version That was weird. I thought I am crazy when I can't reproduce it in the typescript playground. So we fixed it with some unrelated changes 😆. Still worth the effort for the visibility.
Closing since svelte-check now requires a later version that doesn't have this problem. If anyone encounter this you can update svelte to 3.51 or later.
Describe the bug
There'll be a type check error when the Component type definition extends
SvelteCopmonentTyped<{}, {}, {}>
in strict mode. Not sure if we should count it as a bug because it's possible to avoid it in the userland.The error is
Reproduction
Expected behaviour
no error.
System Info
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered: