module-builder icon indicating copy to clipboard operation
module-builder copied to clipboard

Nuxt 4 module author: Component slot prop types missing.

Open juanpscotto opened this issue 1 month ago • 3 comments

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: [email protected]
  • 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


juanpscotto avatar Nov 28 '25 19:11 juanpscotto