Search code examples
angularintellij-ideatsconfig

Angular Alias Paths not getting resolved in Intellij


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.


Solution

  • 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?