Visual Studio Code can’t resolve angular’s tsconfig paths

I figured it out, even if I’m keep thinking that is all absurd…

VsCode automatically looks for a tsconfig.json file and it doesn’t care about tsconfig.app.json, so paths needs to be specified in tsconfig.json.

At the same time, the angular-cli scaffolding specify a baseUrl parameter in tsconfig.app.json which overrides the upper one.

The solution is to delete baseUrl parameter in the tsconfig.app.json or edit its value to "../"

(As a personal remark, given that vscode is largely used to build angular solutions, I think that there’s something that should be revisited in the angular-cli scaffolding or in how vscode looks for tsconfig files)

Leave a Comment