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

Type error of inheritAttrs on TSX component #8572

Closed
wonderl17 opened this issue Jun 14, 2023 · 7 comments
Closed

Type error of inheritAttrs on TSX component #8572

wonderl17 opened this issue Jun 14, 2023 · 7 comments

Comments

@wonderl17
Copy link
Contributor

Vue version

3.3.4

Link to minimal reproduction

https://github.com/wonderl17/vue-tsx-error

Steps to reproduce

C2.vue:
image
C1.vue:
image
Dev.vue:
image

run pnpm vue-tsc and get error:
image

What is expected?

no type error

What is actually happening?

type error shown

System Info

No response

Any additional comments?

No response

@laterdayi
Copy link

same vuejs/language-tools#3301

@liulinboyi
Copy link
Member

Maybe you can find the solution in the typescript jsx.

@laterdayi
Copy link

@liulinboyi I'm not sure what caused it, but before it was OK

@liulinboyi
Copy link
Member

Maybe the Typescript or the Volar has update, so i suggest you can find the solution in the typescript jsx or the Volar release log or the both repo issue.

@liulinboyi
Copy link
Member

liulinboyi commented Jun 18, 2023

I think the Attribute type checking part can solve this issue.

vite-env.d.ts

/// <reference types="vite/client" />

declare module "*.vue" {
    import { DefineComponent } from "vue";

    const component: DefineComponent<{}, {}, any>;

    export default component;
}

// I had a try, add this namespace to resolve this issue
declare namespace JSX {
    interface IntrinsicAttributes  {
        msg: string;
    }
}

@laterdayi
Copy link

Thank you. I think it's volar

@edison1105
Copy link
Member

The issue can no longer be reproduced with:

  "dependencies": {
    "vue": "3.5.12"
  },
  "devDependencies": {
    "typescript": "5.6.3",
    "vue-tsc": "2.1.10"
  },

@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants