Repository navigation
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptNeeds More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarifiedRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
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
Reacted by Alex Komlev, Austin Craft, Kip Obenauf, Romel Perez, Matt Chaney, Mike, phifa, Lucas Basquerotto, Alexander Chashchin, John Holliday and 141 more
Reacted by Vijay Ravichander, Bright Bassey and Erik
Reacted by Sahin, Stanley Owen, SToneX, generalusersa, themiagroup, tamer and Erik
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptNeeds More InfoThe issue still hasn't been fully clarifiedThe issue still hasn't been fully clarifiedRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Activity
mjbvz commentedon Apr 26, 2021
Please share your tsconfig and a overview of your project structure
kimlimjustin commentedon Apr 27, 2021
It's an electron project, structure:
My tsconfig.json file is generated by
tsc --initcommand.sheetalkamat commentedon May 10, 2021
I am not able to repro this with simple delete or file move.. Can you create a small repro project and list the steps (where are you moving file or which file are you deleting) Also sharing
tsserver.logwould be very helpful. ThanksYou can upload logs by following these steps:
"typescript.tsserver.log": "verbose"TypeScript: Open TS Server logcommandtsserver.log. Please share this file. Additionally you can also share fileti.logcreated next to it.kimlimjustin commentedon May 12, 2021
You can repro this bug by these steps:
electron-quick-startmain.jstomain.tsmainvalue onpackage.jsontomain.tshello.tsCode for
hello.ts:preload.jsfile add these line:test, movehello.tsinto the folder, update import on thepreload.jsfiletsserver.log
ti-66130.log
anandvc commentedon Jun 23, 2021
Following.
I had a similar issue come up after duplicating a .tsx file and then renaming the copy.
Ark-kun commentedon Jun 25, 2021
I always have this error when moving unused
*.tsfiles to another folder or deleting them.I have to kill and re-run
npm startto make it work again90 remaining items
divmgl commentedon Jan 31, 2024
Heads up that modifying your
tsconfig.jsonfile will cause the TypeScript language server to automatically restart. So it's unlikely these issues are fixed by just changing theinclude. The TypeScript team needs to fix this issue.ShahabDadKhan commentedon Feb 6, 2024
I was looking for the solution then I was told just close your VScode and reopen it, the error is gone now. All my expectations that it would be a bug have gone in vain, It sucks.
Prem-Dharshan commentedon Jun 6, 2024
I had a similar issue
This happened when I cancelled the popup by VSC which asked
refactor the imports?. I simply ignored it and that resulted in this error.Solution:I re-created the file
user0session.entity.tsand then deleted it correctly. The error was gone like magic.Probably in your case, copy the contents and delete the config file. Re-create it with the same contents.
Hope this helps.
danilofuchs commentedon Jun 21, 2024
Enabling
typescript.tsserver.experimental.useVsCodeWatcher: trueandtypescript.tsserver.experimental.enableProjectDiagnostics: trueat the same time causes this error.My solution: Set
typescript.tsserver.experimental.useVsCodeWatcher: falsevirtuallyunknown commentedon Jun 26, 2024
Update to Typescript 5.5, it fixes this problem. The current version of VSCode ships with Typescript 5.4.5, however you can easily change it to use the "workspace" version, assuming you have installed latest Typescript in your project.
Open the command palette (
ctrl+shift+p) ->Typescript: Select Typescript Version.#58120 (I think).
uphiago commentedon Jun 27, 2024
We can just update it in VSCode, as virtuallyunknown mentioned. This should fix the problem.
sheetalkamat commentedon Jun 27, 2024
If you are still facing issues after updating to typescript@latest or typescript@next , please open new issue as this one is old and things have changed since then,.
We need clear repro steps and tsserver log when you open the issue to be able to investigate it.
Thanks
velara3 commentedon Aug 5, 2024
This happened on 5.5.4. . Deleted a ts file in /src/routes/my.ts. Found this thread. Restarted TS server and now the message is gone. Will try to create a new issue if it happens again and add steps to reproduce.
Steps might have been:
Sanan4li commentedon Sep 23, 2024
Not sure if this will help but another developer working on the same project created a folder
Activitybut we had all the pages with lowercase characters. After renamingActivitytoactivityit worked.donverduyn commentedon Nov 4, 2024
For those looking for a workaround that actually does work (assuming restart TS server is an acceptable solution). When using vscode, you can install the extension https://marketplace.visualstudio.com/items?itemName=gabrielgrinberg.auto-run-command
Add this to .vscode/settings.json
Relaunch window and you're done.
rookbreezy commentedon Mar 16, 2025
Adding to donverduyns clever workaround:
auto-run-commanddid not work for me but I found another extension that did: https://marketplace.visualstudio.com/items?itemName=appulate.filewatcherAlso works when deleting folders.
settings.json: