After many sad days chasing this issue - I finally discovered the GitHub Issue on the GitHub VS Code, which explains what is happening.
TL; dr
My tsconfig.json file was not configured correctly. To fix this, I deleted the files section. You may also have to delete it in your project or just “fix” it to include all the relevant .ts files.
Longer version
Adding a file [section] restricts our project to these two files, and if you open other files that are not referenced from these two files, they will end up in an isolated virtual project . You need to either skip the file section (then all .ts files under the tsconfig.json file are automatically considered part of the project), or you need to list all the files of your project in this section.
My original tsconfig.json file was:
{ "compilerOptions": { "target": "es5", "sourceMap": true, "removeComments": true, "noImplicitAny": true }, "files": [ "typings/index.d.ts", "src/typings/index.d.ts" ] }
So, VS Code believes that my project consists of only two files. Other .ts files I .ts were considered an “isolated virtual project” - it’s not difficult to understand why they generate errors.
I changed my tsconfig.json file to the following:
{ "compilerOptions": { "target": "es5", "sourceMap": true, "removeComments": true, "noImplicitAny": true } }
The problem is solved!
rinogo
source share