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

Generic & Falltrough Attributes: Object literal may only specify known properties... #3318

Closed
JosepBergay opened this issue Jun 22, 2023 · 2 comments · Fixed by #3487
Closed
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@JosepBergay
Copy link

JosepBergay commented Jun 22, 2023

Vue version

3.3.4

Description

If the component is generic vue-tsc complains when an html attribute is bound to it.

What is expected?

I expect to bind any html attribute to a component without errors.

What is actually happening?

Volar and vue-tsc show an error on the first attribute, thinking that it's a prop and it needs to be defined on the child component.

REPRO

  1. Open: stackblitz

  2. Run: npx vue-tsc

  3. Full Error:

src/App.vue:11:25 - error TS2345: Argument of type '{ val: any; id: string; }' is not assignable to parameter of type '{ val: any; } & VNodeProps & AllowedComponentProps & ComponentCustomProps'.
  Object literal may only specify known properties, and 'id' does not exist in type '{ val: any; } & VNodeProps & AllowedComponentProps & ComponentCustomProps'.

11   <Generic :val="value" id="id" />
                           ~~


Found 1 error in src/App.vue:11

Probably related issues:

#3201

@laterdayi
Copy link

#3301

@so1ve
Copy link
Member

so1ve commented Aug 17, 2023

This issue will be fixed by #3487, which makes strictTemplates: false work with generic components. If you enable that option, #3443 will occur - but they are different issues.

@so1ve so1ve added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Aug 17, 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 good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants