Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typescript path in VS code

I can't get typescript paths to work for VS Code in an Angular cli project.

If you look at https://github.com/gatimus/multiple-test/blob/master/src/app1/app/app.module.ts#L3 throws

[ts] Cannot find module 'shared/shared.module',

even though path is set in tsconfig.app.json and settings.json has the line

"typescript.tsdk": "node_modules/typescript/lib/"

Update: It seems the apps run but VS Code can't find the module. I have version 1.16.1 enter image description here

like image 954
William Lohan Avatar asked Sep 27 '26 18:09

William Lohan


1 Answers

Renaming tsconfig.app.json to tsconfig.json and updating .angular-cli.json seems to work.

I am curious though, if the tsconfig file wasn't configurable in angular cli, how would you tell VS Code to use tsconfig.app.json?

like image 147
William Lohan Avatar answered Sep 30 '26 13:09

William Lohan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!