Nuxt 4 module author: Component slot prop types missing.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 275
- Forks
- 35
- Avg merge
- 4h 42m
- Merged PRs (30d)
- 6
Description
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:
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:
NavigationComponent.d.vue.ts
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.
Logs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproduction and run npm run dev:prepare && npm run prepack. Inspect the generated dist/runtime/components/NavigationComponent.d.vue.ts and NavigationComponent.vue.d.ts, comparing the content slot's data prop with NavigationItem[] from NavigationComponent.vue. Done means the generated declarations preserve the slot prop type instead of emitting any.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxtjs, typescript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100