-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
"Problems" panel is displaying TypeScript errors from /node_modules/ packages with typescript.tsserver.experimental.enableProjectDiagnostics enabled #117732
Comments
I'm also noticing the number in problems tab constantly changing, regardless if I run a script to start the project or not, or perform any other actions. I just open VS Code (v1.47.1) and notice number get to 100+, then 300+, then 400+, then drop to 200+, go back up, etc... Here's the screenshot from the top of the list, just so you can have an idea: My system info:
|
Yes actually that's something I forgot to mention in the OP. The number of errors jumps around a bit. For the "6" And haven't even touched my |
I have exactly the same issue with ts-invariant when |
I had this enabled for some reason and when I've added |
I'm also having those errors. I was really shocked when I first tried out this experimental feature and noticed 3k+ errors in my project 😅 Is there any option to let it exclude node_modules? Feels like my MacBook is trying to kill itself by scanning the entire project including node_modules.... |
I confirm the bug is there! I really like the concept behind the feature to show all my project's errors in disregard if the files are open, but this feature is currently poorly supported so that becomes unusable. I would never want it to analyze That doesn't seem to happen with all entirety of projects though, but it's hard to tell why exactly it's happening and why it's so random and continue to disappear and appear again sometimes. My screenshot: Btw, it doesn't seem project's More than that: one single file sometimes appears valid and no errors (with valid types, etc.), fully working, but then with no change it suddenly has errors, then again it's good, etc. - the same random behavior. So it seems like different {
"extends": "assemblyscript/std/assembly.json",
"exclude": ["node_modules", "./**/*.test.ts"]
} This config above extends assembly.json extends tsconfig-base.json If I delete it, VSCode stops inspecting node_modules, and this another behavior with random errors inside my file also disappears. But in return I get my types simply broken in a subfolder :\ |
As noted, this is caused by |
@mjbvz nice way to fix the issue! Would you suggest stopping using VSCode in case anybody found any other bugs in it? |
Oh, I’m actually glad it got into Backlog. Thanks @mjbvz! Can’t wait it being fixed |
Until then to avoid those problems I use |
@whazor but this doesn't hide those errors in "problems" panel, isn't it? |
Adding the |
@whazor, oh I actually didn’t even notice “problems” tabs has such a filter. I was confused first, but now I understand about what filter you’re talking about. Yes, this helps a lot, thanks |
Earlier I thought I'm getting this bug only in projects where multiple |
I'm noticing this bug with node_modules folders of folders that I don't even have loaded in my workspace anymore. I even restarted VS Code to confirm. Not sure where this feature is getting it's list of folders to scan, but it's somehow picking up perhaps stale cached copies of it. Edit: Never mind, it seems like I had one file from the folder I no longer had in my workspace open in a tab. It seems like this feature, as might already be known by some, is based on what files you have open and not necessarily what folders you have added in your workspace. |
What about having tsservice just filter out |
@whazor are you talking about the |
@Ploppy3 He's talking about this filter here. Not ideal solution, but hides the irrelevant information (doesn't change the counter though): |
Hiding the problems doesn't negate the large CPU hit caused by the unwanted processing of hundreds of (normally excluded) files. |
Also, hiding the problems still shows the total number of problems (I try to always let my projects without problems, and when a problem shows, I want to fix it ASAP). |
I 100% agree with you both. It is still heck of a problem |
@mjbvz What is the state of this issue ? |
Closing in favor of microsoft/TypeScript#36664 This feature is currently implemented in rather suboptimal way (which is why the setting is marked experimental). If you're running into trouble using it, try setting up a watch task instead, which should perform better overall, the obvious downside being that you have to setup the watch task in the first place |
@mjbvz But it isn't flawed due to being suboptimal, it's flawed because it was misconfigured and doesn't exclude What about the non-Typescript applications for this feature? Whether it was intended or not, it also runs other checks over these files. It's useful to have a generic way to run checks from all extensions. For example, am I going to have to reverse-engineer the Code Spell Checker extension into a task just to be able to do the equivalent with a watch task…? |
Summary
I'm using vscode insiders edition, and with the config option
"typescript.tsserver.experimental.enableProjectDiagnostics": true
to display TypeScript errors for my whole projects in the "Problems" panel along the bottom of the screen, i.e. the feature introduced in #13953I seem to have an inconsistent issue with the "Problems" panel randomly displaying errors from
/node_modules/
code (which I obviously can't control/fix):I can see that the error in the screenshot above refers to one of my project files (App.test.tsx) - but the error itself seems to be coming from the package
/node_modules/ts-invariant
(see exampletsconfig.json
files further down). I've tried lots of fiddling with mytsconfig.json
- but the thing is that other stuff that shows TypeScript errors never shows thesenode_modules
errors, so as far as I'm aware, vscode should be the same?...tsc
from the command line, I don't see these errors at all.And many other people have reported the exact same issue in the comments in: #13953 - so seems it's not just me / my project specifically.
Random coming/going
node_modules
errors show, my own project-wide TypeScript errors are already working, so it's not coming/going at the end same time that the rest of the project-wide TS errors are showing - it seems to have its own timing that is affected by something elsetsconfig.json
or any vscode settings at allSteps to Reproduce:
npx create-react-app my_project_name --template typescript
- but from memory, I think I've seen these issues with other non-react projects too.VSCode Version:
Example
tsconfig.json
file from one of my projectsExample
tsconfig.json
from/node_modules/ts-invariant/tsconfig.json
Does this issue occur when all extensions are disabled?: Yes
"C:\Users\username\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe" --disable-extensions
The text was updated successfully, but these errors were encountered: