Visual Studio Code can't resolve angular's tsconfig.base paths

Viewed 599

I have added a custom path in my Angular 9 's tsconfig.base.json and all the components and everything are loading perfectly. But visual Studio Code is complaining and throwing the error Can not find module in my app routing module and app module. How to resolve this issue.

tsconfig.base.json -

{
"compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@/*": ["src/app/*"],
      "@env/*": ["src/environments/*"]
    },
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    ....
}

App module -

import { AppRoutingModule, routingComponents } from '@/app-routing.module';
import { AppComponent } from '@/app.component';
1 Answers

maybe you were editing wrong file,.. i use angular 9.0 too and i make same configuration in tsconfig.json not tsconfig.base.json

Related