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

vue-tsc 2.0.18: Property 'xyz' does not exist on type 'abc' when using v-for #4386

Closed
mlankamp opened this issue May 15, 2024 · 5 comments
Closed
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@mlankamp
Copy link

mlankamp commented May 15, 2024

Error is happening when I use certain Vuetify components with a v-for loop.

Ok:

<v-chip closable />

Error:

<v-chip v-for="id in items" :key="id" closable>{{ id }}</v-chip>

vscode:
image

build output:

> vue-tsc

src/App.vue:10:45 - error TS2339: Property 'closable' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{}>>, { items: Ref<number[]>; }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ... 12 more ..., {}>'.

10       <v-chip v-for="id in items" :key="id" closable>{{ id }}</v-chip>

example: https://stackblitz.com/edit/vitejs-vite-weuexn?file=package.json,src%2FApp.vue&terminal=build

@mityaua
Copy link

mityaua commented May 15, 2024

Same problem with Quasar but only after build + type-check (vue-tsc --noEmit -p tsconfig.vitest.json --composite false)

error TS2339: Property 'dense' does not exist on type 'CreateComponentPublicInstance<Readonly<ExtractPropTypes<{}>>, { mobileTableRef: Ref<HTMLDivElement | null>; isLoadingUsers: ComputedRef<boolean>; ... 19 more ...; showDate: (time: string | null) => string; }, ... 17 more ..., {}>'.

<q-item v-for="user in users" :key="user.id" dense class="user border-radius-md column bg-secondary">

@TheDutchCoder
Copy link

This also occurs on regular components.
In our case in Nuxt 3.

The "solution "is to use :foo="true" instead of foo directly, but that's obviously not how it's supposed to work.
We'll skip this version until a fix is released.

@mlankamp
Copy link
Author

I first noticed with Vuetify, but my example uses the stackblitz vue-ts template with an extra boolean prop to demonstrate the problem.

@robertmoura
Copy link

robertmoura commented May 15, 2024

I'm also getting this issue. There is another issue that is strange as well. I have a component that looks like this:

<custom-component first-second>

Where the attribute firstSecond is a boolean prop. This is producing 2 errors:

Property 'first' does not exist on type ...
Property 'second' does not exist on type ...

@Wangijun
Copy link

I also encountered this problem

@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 May 16, 2024
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

6 participants