Skip to content

Declaration files d.ts not generated for generic component #4569

@zaalbarxx

Description

@zaalbarxx

Vue - Official extension or vue-tsc version

2.0.26

VSCode version

Vue version

3.4.21

TypeScript version

5.4 and 5.5.3

System Info

No response

Steps to reproduce

  1. Go to this example repo https://stackblitz.com/edit/vite-ungnsb?file=package.json,src%2Fcomponents%2FTableRow.vue,src%2Ftypes.ts,tsconfig.dist.json,src%2Fcomponents%2FTableRowCell.vue,src%2Fcomponents%2FEmptyTableRow.vue
  2. in terminal run vue-tsc -p tsconfig.dist.json
  3. Check dist folder

What is expected?

I would expect that dist folder contains components/EmptyTableRow.vue.d.ts and components/TableRow.vue.d.ts files.

What is actually happening?

For some reason the declaration files are not emitted for these components. But interesingly the AppTableRowCell is also a generic component which look quite similar to AppTableRow and the declaration file is emitted correctly for it. When I either remove defineProps() from EmptyTableRow.vue or remove the generic="..." the declaration file is then emitted. It is quite strange, because no error is being emitted from the command itself, it's just that the files are not there.

Link to minimal reproduction

https://stackblitz.com/edit/vite-ungnsb?file=package.json,src%2Fcomponents%2FTableRow.vue,src%2Ftypes.ts,tsconfig.dist.json,src%2Fcomponents%2FTableRowCell.vue,src%2Fcomponents%2FEmptyTableRow.vue

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood reproduction ✨This issue provides a good reproduction, we will be able to investigate it first

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions