-
Notifications
You must be signed in to change notification settings - Fork 12.8k
VSCode ignores paths in tsconfig.app.json #21473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
That is very odd. VSCode doesn't seem to be walking up the folder structure. I had to use tsconfig.json in src folder for paths to take effect. Why should tsconfig.app.json be ignored by VSCode? Why can't there be some consistency here? I don't want to open the folder where node_modules are present - even though that is where tsconfig.json is also present. VSCode essentially becomes useless if I open the folder where node_modules resides - because search in files and other functionality becomes a pain. Main thing is that webpack stops working if it can't find tsconfig.app.json in the src folder. So now I have to have both tsconfig.app.json and tsconfig.json reside in the src folder. All of this seems very messy. If only VSCode can consume tsconfig.app.json. |
All tools, both VSCode, VS, sublime, and tsc look for a special file with one known name..
I think you are running into #21209. you should not need to open the project containing the tsconfig.json for it to work, but this is currently a bug and should be fixed soon. |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
I'm running into this problem, but I'm adding the "paths" on the correct, main |
Also hitting this issue with a Using |
Same issue - don't want to have to put in to node_modules/@types tsconfig : "baseUrl": "./", |
@brandonmp and @tonyhallett can you share a project we can use to diagnose the issue. |
@mhegazy Sorry failed to mention that this was a regular tsconfig.json. Shall I still provide a project or raise another issue ? |
yes please. |
@mhegazy It is now working ! The package.json was originally missing, tsc worked despite that. Perhaps it was the package.json or vscode needed reopening. Regardless is working. Thanks |
I ran into the same issue with VSCode 1.23.1 and TypeScript 2.8.3. Closing and reopening VSCode fixed it for me. In my case, tsconfig.json didn't have a "paths" entry when the project was opened, and I added it from within VSCode. Perhaps this problem only occurs if such an entry is added when the project is open? |
@ronp001 do you have a tsserver log for that session? |
@mhegazy where should I look for such a log? |
You can upload logs using
|
@mhegazy unfortunately I am unable to reproduce the problem. I tried to go through the same steps again, but the issue does not recur. I will keep verbose logging on for a while and send over if I run into this again before the logs threaten to fill up my hard drive. |
TypeScript Version: 2.6.2
Search Terms:
VsCode ignore paths in tsconfig.json tsconfig.app.json
Code
Expected behavior:
VSCode should resolve the path
@views/viewa/viewa.component
just fine - and just asng serve
doesActual behavior:
VSCode says:
file: 'test-app/src/app/app.module.ts'
severity: 'Error'
message: 'Cannot find module '@views/viewa/viewa.component'.' at: '7,32' source: 'ts' code: '2307'
ng serve works fine with the paths
Note: I restarted VSCode multiple times (esp. after editing tsconfig.app.json (or tsconfig.json)
The text was updated successfully, but these errors were encountered: