0

I'm working on an angular 5 project which happened to be my first type script app. I've added the below configurations in my tsconfig.json

"baseUrl": "src", //had to add this too
    "paths": {
        "@env/*": ["environments/*"],
        "@core/*": ["app/core/*"],        
        "@sim-shared/*": ["app/shared/*"]
    }

When I try to access it from my component or service like

import xxx from '@env/XXX';

It gives me couldn't resolve the path error.

I've already tried disabling the angular language service which didn't help. Any help is really appreciated.

Ajay Srikanth
  • 1,095
  • 4
  • 22
  • 43
  • Are you looking for "sexier Imports" in Type sscript https://netbasal.com/sexier-imports-in-typescript-e3c645bdd3c6 ? – Eliseo Feb 05 '19 at 07:53
  • he is already using sexier imports and they are not resolved well in IDE because of this reason: https://stackoverflow.com/questions/53173306/visual-studio-code-cant-resolve-angulars-tsconfig-paths – Eduard Void Jun 04 '20 at 06:25

1 Answers1

1

Since your paths look correct, you should use the invalidate caches / restart option (I reproduced this with a new project and you are on the right path). I don't believe it's the Language Service. Does anyone else has any ideas on why IntelliJ (and Webstorm) don't seem to update with the paths?