unovue / shadcn-vue

Vue port of shadcn-ui
https://www.shadcn-vue.com/
MIT License
5.31k stars 316 forks source link

[Bug]: Sidebar #893

Open IStarWatcher opened 2 weeks ago

IStarWatcher commented 2 weeks ago

Reproduction

https://github.com/unovue/shadcn-vue/blob/dev/apps/www/src/lib/registry/default/ui/sidebar/SidebarMenuButton.vue

Describe the bug

when building the project (tsc-vue -b), an error appeared in the SidebarMenuButton component related to type incompatibility between the SidebarMenuButtonChild component and the properties passed to it the error itself: ''' src/components/ui/sidebar/SidebarMenuButton.vue:30:4 - error TS2345: Argument of type '{ isActive: boolean; class: HTMLAttributes["class"]; asChild: boolean; as: AsTag | Component; variant: "default" | "outline"; size: "default" | ... 1 more ... | "lg"; }' is not assignable to parameter of type 'Partial<{ size: "default" | "sm" | "lg"; as: string; variant: "default" | "outline"; }> & Omit<{ readonly variant?: "default" | "outline"; readonly size?: "default" | "sm" | "lg"; readonly isActive?: boolean; readonly class?: any; readonly asChild?: boolean; readonly as?: AsTag | Component; } & VNodeProps & AllowedC...'. Type '{ isActive: boolean; class: HTMLAttributes["class"]; asChild: boolean; as: AsTag | Component; variant: "default" | "outline"; size: "default" | ... 1 more ... | "lg"; }' is not assignable to type 'Partial<{ size: "default" | "sm" | "lg"; as: string; variant: "default" | "outline"; }>'. Types of property 'as' are incompatible. Type 'AsTag | Component' is not assignable to type 'string'. Type 'ComponentOptions<any, any, any, ComputedOptions, MethodOptions, any, any, any, string, {}, {}, string, {}, {}, {}, string, ComponentProvideOptions>' is not assignable to type 'string'.

30 ''' ''' src/components/ui/sidebar/SidebarMenuButton.vue:36:8 - error TS2345: Argument of type '{ isActive: boolean; class: HTMLAttributes["class"]; asChild: boolean; as: AsTag | Component; variant: "default" | "outline"; size: "default" | ... 1 more ... | "lg"; }' is not assignable to parameter of type 'Partial<{ size: "default" | "sm" | "lg"; as: string; variant: "default" | "outline"; }> & Omit<{ readonly variant?: "default" | "outline"; readonly size?: "default" | "sm" | "lg"; readonly isActive?: boolean; readonly class?: any; readonly asChild?: boolean; readonly as?: AsTag | Component; } & VNodeProps & AllowedC...'. Type '{ isActive: boolean; class: HTMLAttributes["class"]; asChild: boolean; as: AsTag | Component; variant: "default" | "outline"; size: "default" | ... 1 more ... | "lg"; }' is not assignable to type 'Partial<{ size: "default" | "sm" | "lg"; as: string; variant: "default" | "outline"; }>'. Types of property 'as' are incompatible. Type 'AsTag | Component' is not assignable to type 'string'. Type 'ComponentOptions<any, any, any, ComputedOptions, MethodOptions, any, any, any, string, {}, {}, string, {}, {}, {}, string, ComponentProvideOptions>' is not assignable to type 'string'.

36 '''

System Info

System:
  Binaries:
    node - 22.11.0
    npm - 10.9.0
  npmPackages:
    "typescript": "5.6.3",
    "vue": "^3.5.12",
    "radix-vue": "^1.9.8",

Contributes

brokuka commented 1 week ago

image Some strange bug too