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

1.4.0 bug with e.g <v-btn type="submit" /> #2636

Closed
patroza opened this issue Apr 20, 2023 · 5 comments
Closed

1.4.0 bug with e.g <v-btn type="submit" /> #2636

patroza opened this issue Apr 20, 2023 · 5 comments
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@patroza
Copy link

patroza commented Apr 20, 2023

repro @ https://github.com/patroza/vite-vue-volar-bug/commit/e5662a59fb37aa3921c1c19f1f5de8be0914483b

<v-btn :disabled="false" type="submit">hello</v-btn>

vscode error:

Argument of type '{ disabled: false; type: string; }' is not assignable to parameter of type 'Partial<{ symbol: any; replace: boolean; flat: boolean; exact: boolean; block: boolean; active: boolean; disabled: boolean; size: string | number; tag: string; rounded: string | number | boolean; density: Density; variant: NonNullable<...>; stacked: boolean; ripple: boolean; }> & Omit<...>'.\n  Object literal may only specify known properties, and 'type' does not exist in type 'Partial<{ symbol: any; replace: boolean; flat: boolean; exact: boolean; block: boolean; active: boolean; disabled: boolean; size: string | number; tag: string; rounded: string | number | boolean; density: Density; variant: NonNullable<...>; stacked: boolean; ripple: boolean; }> & Omit<...>'.

pnpm build error:

src/App.vue:6:28 - error TS2345: Argument of type '{ disabled: false; type: string; }' is not assignable to parameter of type 'Partial<{ symbol: any; replace: boolean; flat: boolean; exact: boolean; block: boolean; active: boolean; disabled: boolean; size: string | number; tag: string; rounded: string | number | boolean; density: Density; variant: NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">; stacked: boolean; ripple: boolean; }> & Omit<{ symbol: any; replace: boolean; flat: boolean; exact: boolean; block: boolean; disabled: boolean; size: string | number; tag: string; density: Density; variant: NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">; stacked: boolean; ripple: boolean; } & { location?: Anchor | undefined; height?: string | number | undefined; width?: string | number | undefined; active?: boolean | undefined; border?: string | number | boolean | undefined; color?: string | undefined; maxHeight?: string | number | undefined; maxWidth?: string | number | undefined; minHeight?: string | number | undefined; minWidth?: string | number | undefined; position?: "fixed" | "absolute" | "static" | "relative" | "sticky" | undefined; ... 10 more ...; appendIcon?: IconValue | undefined; } & ... 5 more ... & ComponentCustomProps, "symbol" | ... 12 more ... | "ripple">'.
  Object literal may only specify known properties, and 'type' does not exist in type 'Partial<{ symbol: any; replace: boolean; flat: boolean; exact: boolean; block: boolean; active: boolean; disabled: boolean; size: string | number; tag: string; rounded: string | number | boolean; density: Density; variant: NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">; stacked: boolean; ripple: boolean; }> & Omit<{ symbol: any; replace: boolean; flat: boolean; exact: boolean; block: boolean; disabled: boolean; size: string | number; tag: string; density: Density; variant: NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">; stacked: boolean; ripple: boolean; } & { location?: Anchor | undefined; height?: string | number | undefined; width?: string | number | undefined; active?: boolean | undefined; border?: string | number | boolean | undefined; color?: string | undefined; maxHeight?: string | number | undefined; maxWidth?: string | number | undefined; minHeight?: string | number | undefined; minWidth?: string | number | undefined; position?: "fixed" | "absolute" | "static" | "relative" | "sticky" | undefined; ... 10 more ...; appendIcon?: IconValue | undefined; } & ... 5 more ... & ComponentCustomProps, "symbol" | ... 12 more ... | "ripple">'.

6   <v-btn :disabled="false" type="submit">
                             ~~~~


Found 1 error in src/App.vue:6

broken since 1.4.0, works fine with the previous version.

@patroza patroza changed the title 1.4.0 bug with v-btn type="submit" 1.4.0 bug with e.g <v-btn type="submit" /> Apr 20, 2023
@patroza patroza changed the title 1.4.0 bug with e.g <v-btn type="submit" /> 1.4.0 bug with e.g <v-btn type="submit" /> Apr 20, 2023
@patroza patroza changed the title 1.4.0 bug with e.g <v-btn type="submit" /> 1.4.0 bug with e.g <v-btn type="submit" /> Apr 20, 2023
@seattlewayne
Copy link

I am running into the same problem with adding a download property to my button. This worked for me until 1.4.0 as well.

  <v-btn
    :href="createDownloadContent()"
    download="samplefile.txt"
  >

It looks like vue-tsc is throwing an error for props that are passed through.

@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Apr 21, 2023
@nowo
Copy link

nowo commented Apr 21, 2023

I'm using element-plus, which also gets a lot of wrong type notifications
image
I am using Element Plus, which also receives many error type notifications. I chose to revert back to the previous version v1.2.0 and it works fine
image

@JJLee9527
Copy link

JJLee9527 commented Apr 21, 2023

Same issue here ✋

1 similar comment
@xue-lei
Copy link

xue-lei commented Apr 21, 2023

Same issue here ✋

@MrSong0607
Copy link

Same issue here ✋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

7 participants