carbon-design-system / carbon-icons-svelte

Carbon Design System SVG icons as Svelte components
https://carbon-icons-svelte.onrender.com
Apache License 2.0
397 stars 22 forks source link

Deprecated `SvelteComponentTyped` in Svelte 4 #190

Open MoritzKronberger opened 1 week ago

MoritzKronberger commented 1 week ago

Using Svelte 4.2.7 with carbon-icons-svelte 12.11.0 and carbon-components-svelte 0.85.2 setting icons on carbon components raises errors such as:

Types of construct signatures are incompatible.
  Type 'new (options: ComponentConstructorOptions<CarbonIconProps>) => Asleep' is not assignable to type 'new <Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any>(options: ComponentConstructorOptions<Props>) => SvelteComponent<Props, Events, Slots>'.
    Construct signature return types 'Asleep' and 'SvelteComponent<Props, Events, Slots>' are incompatible.
      The types of '$$prop_def' are incompatible between these types.
        Type 'CarbonIconProps' is not assignable to type 'Props'.
          'CarbonIconProps' is assignable to the constraint of type 'Props', but 'Props' could be instantiated with a different subtype of constraint 'Record<string, any>'.ts(2419)

To me this looks like an issue of carbon icons being typed as SvelteComponentTyped which is now deprecated?

metonym commented 2 days ago

This is unexpected. Could you first try restarting the Svelte Language Server in your IDE?