TypeScript: Renaming file triggers error in tsconfig.json

TS Template added by @mjbvz

TypeScript Version: 4.5.0-dev.20211019

Search Terms

  • jsconfig / tsconfig
  • config
  • configFileDiag

See https://github.com/microsoft/TypeScript/issues/46432#issuecomment-940813629 for the simplest repo


Issue Type: Bug

The project is in JS but has configured TS support with tsconfig.json. After renaming source file in explorer pane, following error appears twice in problems pane pointing to tsconfig.json:

File '/home/jarek/work/wymarsz/wk-web/node_modules/source-map/source-map' not found.
  The file is in the program because:
    Root file specified for compilation

The issue appears also with all extensions disabled.

The error goes away after window reload.

Reproductible: always.

VS Code version: Code 1.60.0 (e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff, 2021-09-01T10:43:02.136Z) OS version: Linux x64 5.4.0-81-generic Restricted Mode: No

System Info
Item Value
CPUs AMD Ryzen 5 3400G with Radeon Vega Graphics (8 x 2002)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 1, 1, 1
Memory (System) 29.34GB (23.56GB free)
Process Argv –unity-launch --crash-reporter-id 75655822-4d79-453c-9a0d-23266699ca32
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
Extensions (6)
Extension Author (truncated) Version
vscode-eslint dba 2.1.23
gitlens eam 11.6.0
EditorConfig Edi 0.16.4
prettier-vscode esb 8.1.0
dotenv mik 1.0.1
sass-indented syl 1.8.18

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
pythonvspyt639:30300192
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
pythonvsuse255:30340121
vscod805:30301674
pythonvspyt200:30340761
vscextlangct:30333562
binariesv615:30325510
vsccppwt:30329788
pythonvssor306:30344512
bridge0708:30335490
pygetstartedt2:30360495
bridge0723:30353136
pythonf5test824:30361777
vsdyn478:30356813
pythonvspyt187cf:30362783
pydsgst2:30361792
vscus224:30358039
vssid140:30362080

Zrzut ekranu z 2021-09-07 11-53-45

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 20 (5 by maintainers)

Most upvoted comments

I see people asking for that on Reddit and SO and the only answer is “reload window to fix temporarily”.

The package (and file) definitely exists:

$ ls -al /home/jazg/work/wymarsz/wk-web/node_modules/source-map/source-map.js 
-rw-rw-r-- 1 jazg jazg 405 sie 30 00:45 /home/jazg/work/wymarsz/wk-web/node_modules/source-map/source-map.js

Actually, all you need to do is reload the TS server, that’s an F1 action as well.

  1. Open project directory in VSC.
  2. Right click in explorer on one of JS files, select Rename.
  3. Change name of file, hit enter; error in tsconfig.json appears.
  4. Reload window; error in tsconfig.json goes away.

Subsequent rename operations do not trigger this behaviour.

I see people asking for that on Reddit and SO and the only answer is “reload window to fix temporarily”.

The package (and file) definitely exists:

$ ls -al /home/jazg/work/wymarsz/wk-web/node_modules/source-map/source-map.js 
-rw-rw-r-- 1 jazg jazg 405 sie 30 00:45 /home/jazg/work/wymarsz/wk-web/node_modules/source-map/source-map.js