Skip to content

tsconfig.json shows an error after files are renamed #57340

@Ivan-Kouznetsov

Description

@Ivan-Kouznetsov

Type: Bug

  1. Create a project that uses Node.js and TypeScript in WSL2 running Ubuntu
  2. Create use a tsconfig.json file that has an include field like this
{
  "compileOnSave": true,
  "compilerOptions": {
    "target": "ES2015",
    "module": "commonjs",
    "sourceMap": true,
    "lib": ["es6", "DOM"],
    "esModuleInterop": true,
    "strictNullChecks": true
  },
  "include": ["src/**/*.ts"],
  "exclude": []
}
  1. Open the project in Visual Studio Code via code .
  2. Add some .ts files in the src folder
  3. Rename a ts file

Observe that tsconfig.json now shows an error along the lines of

File '/path/to/src/file1.ts' not found.
  The file is in the program because:
    Matched by include pattern 'src/**/*.ts' in '/path/to/tsconfig.json'

VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:49:37.021Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Remote OS version: Linux x64 5.10.16.3-microsoft-standard-WSL2

System Info
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.10.16.3-microsoft-standard-WSL2
CPUs AMD Ryzen 5 5600G with Radeon Graphics (12 x 3892)
Memory (System) 7.71GB (5.93GB free)
VM 0%
Extensions (4)
Extension Author (truncated) Version
remote-wsl ms- 0.81.8
vscode-eslint dba 2.4.2
copilot Git 1.145.0
copilot-chat Git 0.11.1
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vshan820:30294714
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
py29gd2263:30899288
vsclangdf:30486550
c4g48928:30535728
azure-dev_surveyone:30548225
f6dab269:30613381
vscrpc:30673769
pythongtdpath:30769146
i26e3531:30792625
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2cf:30928864
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:30885898
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
aa_t_chat:30882232
cp7184t3:30927821

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions