question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tsconfig show typescript file not found error after moving it to another directory or delete it.

See original GitHub issue

Issue Type: Bug

When I move a typescript file from a directory into another directory or delete the file from vscode, it shows a problem in tsconfig.json file:

File '/home/justin/Projects/dochub/src/menu.ts' not found.
The file is in the program because:
Matched by include pattern '**/* ' in '/home/justin/Projects/dochub/tsconfig.json' ts [1, 1]

I mean, yeah of course it’s not found because I moved it into another directory.

Reopening vscode will solve this, but it is annoying … Hope this will be fixed soon 😃

VS Code version: Code 1.55.2 (3c4e3df9e89829dce27b7b5c24508306b151f30d, 2021-04-13T09:37:02.931Z) OS version: Linux x64 5.11.0-16-generic snap

System Info
Item Value
CPUs AMD Ryzen 3 2200U with Radeon Vega Mobile Gfx (4 x 545)
GPU Status 2d_canvas: unavailable_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
protected_video_decode: disabled_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
Load (avg) 3, 3, 3
Memory (System) 14.66GB (0.16GB free)
Process Argv –force-user-env --no-sandbox --unity-launch --no-sandbox --crash-reporter-id faba7d7b-2fa9-4f50-9547-77949d63445b
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE wayland
Extensions (8)
Extension Author (truncated) Version
gitlens eam 11.4.1
python ms- 2021.4.765268190
jupyter ms- 2021.5.745244803
cpptools ms- 1.3.1
es6-css-minify olb 3.3.2
material-icon-theme PKi 4.6.0
LiveServer rit 5.6.1
material-theme zhu 3.10.13

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspyt653:30270858
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vstry914:30276682
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
pythonvspyt639:30291489
pythontb:30283811
vspre833cf:30267465
pythonptprofiler:30281270
vshan820cf:30276953
pythondataviewer:30285071
vscus158:30286553

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:80
  • Comments:54 (4 by maintainers)

github_iconTop GitHub Comments

329reactions
lucasbasquerottocommented, Aug 22, 2022

I was able to avoid this issue by restarting the typescript server (in vscode: Ctrl+Shift+p -> Typescript: Restart TS Server). I would prefer a proper solution tough.

73reactions
kimlimjustincommented, Jul 14, 2021

Good to know I’m not alone! Thought this was a problem with CRA-TypeScript. I did find (someone else’s solution which I scoured upon) that deleting node-modules and then running “yarn” or “npm install” to reinstall them will fix it. A huge pain though, especially with large projects on a slower/older computer…

Actually reopening vscode will fix this, but it’s really really annoying tho, that’s why I opened this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript, error in tsconfig.json when importing module from ...
1 Answer 1 · The rootDir setting, if not explicitly set, defaults to the directory containing the tsconfig.json file. · All implementation files...
Read more >
TSConfig Reference - Docs on every TSConfig option
Intro to the TSConfig Reference. A TSConfig file in a directory indicates that the directory is the root of a TypeScript or JavaScript...
Read more >
TypeScript | IntelliJ IDEA Documentation - JetBrains
In the Options field, specify the command-line options to be passed to the TypeScript Language Service when the tsconfig.json file is not found....
Read more >
jsconfig.json Reference - Visual Studio Code
File Scope - no jsconfig.json: In this mode, JavaScript files opened in Visual Studio Code are treated as independent units. As long as...
Read more >
TypeScript - webpack
js file in our current directory. Now lets change the import of lodash in our ./index.ts due to the fact that there is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found