-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
Environment
- Operating System:
Darwin
- Node Version:
v22.17.0
- Nuxt Version:
3.17.7
- CLI Version:
3.26.4
- Nitro Version:
2.12.4
- Package Manager:
pnpm@10.12.1
- Builder:
-
- User Config:
compatibilityDate
,devtools
,extends
- Runtime Modules:
-
- Build Modules:
-
Reproduction
Describe the bug
Once I migrated my projects to v4, I noticed that all my type augmentations stopped working.
Let's assume that there is a composable, which has some options:
// layer/app/composables/useFoo.ts
export function useFoo(option: keyof FooOptions) {}
// layer/types/foo.ts
export interface FooOptions {
'from-layer': any
}
and the options are augmented in a project extending the layer, where the composable comes from:
// project/types/index.d.ts
declare module '@layer-foo/types/foo' {
interface FooOptions {
'from-project': any
}
}
export {}
In v3, both options were accepted:
However, in v4, only the base interface is considered:
Additional context
The v4 projects are using the new default tsconfig
{
// https://nuxt.com/docs/guide/concepts/typescript
"files": [],
"references": [
{
"path": "./.nuxt/tsconfig.app.json"
},
{
"path": "./.nuxt/tsconfig.server.json"
},
{
"path": "./.nuxt/tsconfig.shared.json"
},
{
"path": "./.nuxt/tsconfig.node.json"
}
]
}