-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
Description
Environment
app:
- Operating System: `Darwin`
- Node Version: `v18.16.0`
- Nuxt Version: `3.6.5`
- Nitro Version: `2.5.2`
- Package Manager: `[email protected]`
- Builder: `vite`
- User Config: `extends`, `typescript`, `devtools`
- Runtime Modules: `-`
- Build Modules: `-`
nuxt-layer:
- Operating System: `Darwin`
- Node Version: `v18.16.0`
- Nuxt Version: `3.6.5`
- Nitro Version: `2.5.2`
- Package Manager: `[email protected]`
- Builder: `vite`
- User Config: `typescript`
- Runtime Modules: `-`
- Build Modules: `-`
Reproduction
- clone repo https://github.com/DawidKopys/nuxt-schema-error-repro
- run
npm i
in nuxt-layer directory - run
npm i
in app directory - run
npx nuxi typecheck
/npm run dev
/npx vue-tsc --noEmit
insideapp
directory. You should get below error:
../nuxt-layer/app.config.ts:7:16 - error TS2664: Invalid module name in augmentation, module '@nuxt/schema' cannot be found.
7 declare module '@nuxt/schema' {
~~~~~~~~~~~~~~
Found 1 error in ../nuxt-layer/app.config.ts:7
Describe the bug
- the app directory was created by running
npx nuxi@latest init app
from the docs - the nuxt-layer directory was created with nuxt layer template - by running
npx nuxi init --template layer nuxt-layer
command from the docs - type checking was enabled in both directories by simply running
npm install --save-dev typescript vue-tsc
and turning type checking insidenuxt.config.ts
for both directories
So, basically, I have just used the starters for app and layer, turned type checking for them, and I am getting this ts error straight away.
This error is very confusing to me as using @nuxt/schema
was a solution to my previous (similar) issue and it works just fine if I use it in the repo linked in the issue - https://github.com/DawidKopys/nuxt-layers. But for some reason it doesn't work in above simple setup.
Additional context
Using @nuxt/schema
was a solution to my previous (similar) issue and it works just fine if I use it in the repo linked in the issue - https://github.com/DawidKopys/nuxt-layers. But for some reason it doesn't work in above simple setup.
Logs
No response