Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error from @smui/menu #622

Closed
tuckergordon opened this issue Sep 12, 2023 · 5 comments
Closed

Type error from @smui/menu #622

tuckergordon opened this issue Sep 12, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@tuckergordon
Copy link

Describe the bug
There is a type error stemming from @smui/menu. I actually ran into it while using @smui/select. You can see this error in this simple stackblitz

/home/projects/sveltejs-kit-template-default-egyygs/node_modules/@smui/menu/src/SelectionGroupIcon.ts:8:3
Error: Types of construct signatures are incompatible.
  Type 'new (options: ComponentConstructorOptions<{ getElement?: (() => HTMLSpanElement) | undefined; use?: ActionArray | undefined; class?: string | undefined; slot?: string | null | undefined; style?: string | ... 1 more ... | undefined; ... 198 more ...; 'on:fullscreenerror'?: EventHandler<...> | ... 1 more ... | undefined; }>) => Graphic__SvelteComponent_' 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<...>'.
    Construct signature return types 'Graphic__SvelteComponent_' and 'SvelteComponent<Props, Events, Slots>' are incompatible.
      The types of '$$prop_def' are incompatible between these types.
        Type '{ getElement?: (() => HTMLSpanElement) | undefined; use?: ActionArray | undefined; class?: string | undefined; slot?: string | null | undefined; style?: string | ... 1 more ... | undefined; ... 198 more ...; 'on:fullscreenerror'?: EventHandler<...> | ... 1 more ... | undefined; }' is not assignable to type 'Props'.
          '{ getElement?: (() => HTMLSpanElement) | undefined; use?: ActionArray | undefined; class?: string | undefined; slot?: string | null | undefined; style?: string | ... 1 more ... | undefined; ... 198 more ...; 'on:fullscreenerror'?: EventHandler<...> | ... 1 more ... | undefined; }' is assignable to the constraint of type 'Props', but 'Props' could be instantiated with a different subtype of constraint 'Record<string, any>'. 
  class: 'mdc-menu__selection-group-icon',
  component: Graphic,
});

To Reproduce
Steps to reproduce the behavior:

  1. npm i -D @smui/select
  2. Import @smui/select into a component
  3. npm run check to run svelte-check

Additional context
Looks like this showed up in #610 but didn't get resolved as part of #609

@tuckergordon tuckergordon added the bug Something isn't working label Sep 12, 2023
@locus2k
Copy link

locus2k commented Sep 13, 2023

I too am getting the same issue in 7.0.0-beta.15

@hperrin hperrin self-assigned this Sep 14, 2023
@vhscom
Copy link
Contributor

vhscom commented Sep 28, 2023

Pinned and backed down to several other beta versions 14, 13, 12 and 11, then down to beta.0 and all throw the same error. Given this error did not exist in beta.0 and @sveltejs/kit@1.0.1 it seems this is some kind of corner case. Given it's common to run svelte-check as a CI trigger I hope to see a workaround for this if the fix isn't immediately obvious.

@vhscom
Copy link
Contributor

vhscom commented Oct 4, 2023

Possible root cause: sveltejs/language-tools#1056

@cabreraalex
Copy link

Any way round this?

@hperrin
Copy link
Owner

hperrin commented Dec 27, 2023

This is fixed in 7.0.0-beta.16! (Along with some other TS issues.)

@hperrin hperrin closed this as completed Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants