Home

Issue: 2042

Cannot find module '~components/common/header/header.vue'.

[issue link]

I try to move my project to ts, then this error raise

error TS2307: Cannot find module ‘~components/common/header/header.vue’.

here is tsconfig.json

{
    "compilerOptions": {
      "target": "es5",
      "lib": [
        "dom",
        "es5",
        "es2015"
      ],
      "module": "es2015",
      "moduleResolution": "node",
      "allowJs": true,
      "experimentalDecorators": true,
      //"declaration": true,
      "noImplicitAny": false,
      "noImplicitThis": false,
      "strictNullChecks": true,
      "removeComments": true,
      "suppressImplicitAnyIndexErrors": true,
      "allowSyntheticDefaultImports": true,
      "baseUrl": ".",
      "paths": {
        "~": ["./"],
        "~assets/*": ["./assets/*"],
        "~components/*": ["./components/*"],
        "~middleware/*": ["./middleware/*"],
        "~pages/*": ["./pages/*"],
        "~plugins/*": ["./plugins/*"],
        "~static/*": ["./static/*"]
      }
    }
  }
  

and then, my index.d.ts is an empty file

This question is available on Nuxt.js community (#c1811)