Skip to content
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

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

Closed
Ivan-Kouznetsov opened this issue Jan 7, 2024 · 3 comments · Fixed by #58120
Closed

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

Ivan-Kouznetsov opened this issue Jan 7, 2024 · 3 comments · Fixed by #58120
Assignees
Labels
Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status.

Comments

@Ivan-Kouznetsov
Copy link

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

@Ivan-Kouznetsov
Copy link
Author

Screenshot 2024-01-07 004024

If it helps here is a screenshot of what the bug looks like after I created a minimal project as described above and renamed the file myfile.ts to myfile1.ts

No errors in Developer Tools

@Ivan-Kouznetsov
Copy link
Author

Still happens if all extensions (other than the one for WSL) are disabled

@Ivan-Kouznetsov
Copy link
Author

For ease of reproducing this I created this repo: https://github.com/Ivan-Kouznetsov/rename-bug

@mjbvz mjbvz transferred this issue from microsoft/vscode Feb 8, 2024
@mjbvz mjbvz removed their assignment Feb 8, 2024
@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Feb 8, 2024
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.5.0 milestone Feb 8, 2024
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status.
5 participants