Skip to content

Nuxt 4 module author: Component slot prop types missing. #701

@juanpscotto

Description

@juanpscotto

Environment

  • Operating System: Darwin
  • Node Version: v22.14.0
  • Nuxt Version: 4.2.1
  • CLI Version: 3.30.0
  • Nitro Version: 2.12.9
  • Package Manager: npm@10.9.2
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Public github repo:

https://github.com/juanpscotto/nuxt-4-module-starter-types-issue

Stackblitz:

https://stackblitz.com/github/juanpscotto/nuxt-4-module-starter-types-issue?file=src%2Fruntime%2Fcomponents%2FNavigationComponent.vue%3AL29

In stackblitz wait until the project is setup. Or run this command npm run dev:prepare && npm run prepack if running locally.

Once it has finished check the dist/runtime/components/NavigationComponent.d.vue.ts file, the slot type is missing.

Additional context

There is one component NavigationComponent that has a named slot content with a data prop array of type NavigationItem[]. That type is carried over as any in both NavigationComponent.d.vue.ts and NavigationComponent.vue.d.ts files

NavigationComponent.vue:

Image

NavigationComponent.d.vue.ts

Image

Describe the bug

The slot props types are not being carried over to the generated .ts files of the .vue components. I expect the type of the data props to be recognized.

Image

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions