svelte-material-ui icon indicating copy to clipboard operation
svelte-material-ui copied to clipboard

Type error in tab-bar version 6.0.0

Open lauri-n opened this issue 2 years ago • 1 comments

Running svelte-check on a project that uses tab-bar gives now type errors since SMUI version 6.0.0.

xxx\node_modules\@smui\tab-bar\src\TabBar.types.ts:4:49
Error: Generic type 'TabBar__SvelteComponent_<TabKey>' requires 1 type argument(s).

export declare class TabBarComponentDev extends Component {
  /**


xxx\node_modules\@smui\tab-bar\src\TabBar.types.ts:23:7
Error: Generic type 'TabBar__SvelteComponent_<TabKey>' requires 1 type argument(s).
    [k in keyof TabScrollerComponentDev['$$prop_def'] as `tabScroller\$${k}`]?: TabScrollerComponentDev['$$prop_def'][k];
  } & Component['$$prop_def'];
}


xxx\MyComponent.svelte:42:2
Error: JSX element type 'TabBar' does not have any construct or call signatures. (ts)

This seems to stem from the latest commit to TabBar.types.ts that removed the generic type arguments: https://github.com/hperrin/svelte-material-ui/commit/67f45cc6bd628bd772c8717d20c0699be08e5d0d#diff-8b06dcf1c203cb131e27c62fb0241d13233ca8418ec32d6b181224cd4185135d

If I add back the type arguments in my local copy, the errors go away.

lauri-n avatar Jul 28 '22 06:07 lauri-n

I figured this out. I'll have a fix in v7, where types are getting a big improvement.

hperrin avatar Aug 25 '22 21:08 hperrin

image

how to skip the error lanching svelte-check ?

ghost avatar Feb 11 '23 22:02 ghost

@regnou: FWIW, you can resolve the svelte-check error by upgrading the @smui/tab-bar dependency in package.json to 7.0.0-beta.0. You can do that even if you'd prefer to leave the rest of the @smui/* packages on the latest non-beta release (e.g. 6.1.4).

OldSneerJaw avatar Feb 13 '23 23:02 OldSneerJaw

This is fixed now in v7. :)

hperrin avatar Apr 05 '23 22:04 hperrin