nuxt/kit: incorrect declaration merging
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.9.1
- Nuxt Version:
3-3.0.0-27238235.a1bcc53
- Package Manager:
npm
- Bundler:
Webpack
- User Config:
publicRuntimeConfig
,build
,css
,buildModules
- Runtime Modules:
-
- Build Modules:
-
Describe the bug
It seems that nuxt kit adds a couple of hooks to nuxt but when this package installed by the user these hooks aren’t hinted at when using defineNuxtModule
under the hooks
property
export default defineNuxtModule({
hooks: {
'components:dirs'(dirs) {
// Add ./components dir to the list
dirs.push({
path: path.join(__dirname, 'components')
});
}
}
});
the declaration can be found here.
If this isn’t desired perhaps the type ComponentsDir
can be exported from kit so the user may us it above like 'components:dirs'(dirs: ComponentsDir) {
Reproduction
none
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Documentation - Declaration Merging - TypeScript
For the purposes of this article, “declaration merging” means that the compiler merges two separate declarations declared with the same name into a...
Read more >Member of merged string enum declaration incorrectly ...
declare module './test-module' : This is a declare -- it just declares things to exist, but it doesn't actually emit any code that...
Read more >Typescript Declaration Merging fail about Express Request
This seems to be an issue with how you've configured ts-node . To keep things simple and also speed up startup I'd recommend...
Read more >no-unsafe-declaration-merging - TypeScript ESLint
TypeScript's "declaration merging" supports merging separate declarations with the same name. Declaration merging between classes and interfaces is unsafe.
Read more >Typescript interface declaration merging not working
I am using latest Intellij Idea 14.01 for Typescript dev and I noticed that interface merging was not working. For instance, i wanted...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nandi95 Module authors should always add
@nuxt/kit
as a “dependency”.ah that makes sense, hence why there are packages and a corresponding nuxt package as a wrapper 👍