For the past couple of weeks, I've noticed that vscode is not properly recognizing my tsconfig.json file. It's unclear whether this issue stems from a mistake on my end or an update to vscode...
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@foo-animation/*": [
"src/app/animation/*"
],
...
https://i.sstatic.net/E1ZOG.png
When checking the Problems tab, I encounter the following error:
Cannot find module '@foo-animation/animation-micro' or its corresponding type declarations. ts(2307)
Base paths like @angular/core
are resolved correctly, but the issue seems to be with my custom paths...
Despite having no issues with compiling, building, and running the project, it appears that vscode needs additional information. (My colleagues using IntelliJ do not face any problems...) It appears to be a matter of informing vscode about the paths.
The tsconfig.json
file is located in the root folder of the project. Additionally, I use another tsconfig.app.json
which includes the aforementioned tsconfig.json
.
https://i.sstatic.net/Dcng3.png
Is there a way to instruct vscode where to locate its tsconfig.json file for proper parsing of these paths?
You may find some insights in this Stack Overflow question and this VSCode GitHub issue, but I'm still unsure about how to proceed.