Typescript recognition of auto-imports fail but code compiles correctly
Environment
Nuxt CLI v3.0.0-rc.4 07:25:35 RootDir: /sandbox 07:25:36 Nuxt project info: 07:25:36
- Operating System:
Linux - Node Version:
v14.18.1 - Nuxt Version:
2.16.0-27616340.013f051b - Package Manager:
[email protected] - Builder:
webpack - User Config:
ssr,modules,i18n,compilerOptions,bridge,serverHandlers,devServerHandlers,buildModules - Runtime Modules:
@nuxtjs/[email protected] - Build Modules:
(),@nuxt/[email protected]
Reproduction
-
Open this sandbox: https://codesandbox.io/s/nuxt-bridge-ts-support-fail-ksnuuo?file=/pages/index.vue
-
See that there is a red line below
ref()
-
Hover over the red line and see the text:
`ref' is not defined. (no-undef)eslint
Cannot find name 'ref'.Vetur(2304)
- See that the page renders with no problems -- auto-import works, but TS inside the editor doesn't know about it.
The same problem happens in VScode with Vetur, or with Tsc
Describe the bug
The typescript validator (Vetur or Tsc) do not recognised auto-imported functions.
- After running
npx nuxi preparethe problem is fixed, BUT - After running
npm run devthe problem re-appears
Additional context
TS did work correctly before. The red errors appeared after an upgrade, but I cannot remember from which version to which version.
I noticed this:
- After running
npx nuxi prepare, a file/.nuxt/tsconfig.jsonis created - When running
npm run devthis file/.nuxt/tsconfig.jsondisappears
Logs
No response