According to @jamey graham, the issue arose when working on a React project with typescript
. The solution was to make changes to the tsconfig.json
file as follows:
{
"compilerOptions": {
"baseUrl": "./src",
// ...
},
}
It was also necessary to temporarily remove the
"include": ["src"]
option for file relocation purposes. Visual Studio Code should automatically adjust the paths after this step.
After resolving the issue, you can re-add the
"include": ["src"]
option.
The reason why removing the
"include": ["src"]
fixed the problem remains unclear.
If the issue persists, try opening a .ts
file and executing the Typescript: Restart TS server
command in the terminal before attempting again.