Including this plugin in WebStorm projects breaks TS type checking
ekilah opened this issue · 10 comments
Describe the bug
I recently updated to 5.0.1
of this plugin and regular TS type checking in JetBrains WebStorm doesn't work unless I comment out the plugin
definition in my tsconfig
.
To Reproduce
Making a type error (typo on a variable name, etc) in my React TypeScript project doesn't produce any errors in Webstorm if I include this plugin in tsconfig
. (Note: CSS module stuff, like hovering over an import to see its type or errors about classnames not existing) doesn't work either way, either, which is obviously related)
Expected behavior
Both regular type checking and the extra stuff this plugin should be adding work in WebStorm when this plugin is enabled.
Screenshots
With the plugin disabled, by commenting it out in my tsconfig
With it enabled:
- OS: MacOS Monterey 12.7
- plugin version 5.0.1
- TS version 5.1.6
I'm more than happy to help debug this, since you may not have WebStorm access, though there is a free trial period. I just don't know what I might be looking for.
the same problem appears to happen on this plugin's relatively newly released 5.0.2
, no change.
Hi @ekilah! Sorry you've hit this.
To clarify, are you saying this was fine with version 4.x for you? Have you also updated to TypeScript 5.x?
The plugin should fail and just return an empty object {}
if something is wrong, but it's possible that something else is happening here. Are you able to share the TypeScript server logs?
https://stackoverflow.com/questions/70487104/webstorm-see-typescript-server-logs
I actually updated from this plugin's 3.4.0
-> 5.0.1
, I'd have to test 4.x separately. I only really updated it to get the fixes from
because I was cleaning up some old dependencies in my project. And it looks like this plugin's 4.2.0
would provide that update. However, yes, the project is using TS 5.1.6 (and my editor is using the same version as the project), and I don't know if 4.2.0
will work with TS 5?
I happened to stumble on microsoft/TypeScript#55673 while debugging more. I left a detailed comment there with some logs attached: microsoft/TypeScript#55673 (comment)
Note to myself: getting logs like so, because the webstorm logging util actually doesn't quite work correctly:
export TSS_LOG="-level verbose -file /Users/monroe/tsserver.log" && open -a "WebStorm.app"
You need to use 5.x of this plugin for TypeScript 5.x support. Not intentionally aligned in versions, but there were some breaking changes shipped with that release. Have you tried downgrading to the previous TS release to see if you still encounter that issue?
Thanks for also posting on the TS thread. Perhaps they can provide some more insight. There's obviously something going on, but I'm not sure what and it's seemingly very rare that people hit it - as this extension gets 275k weekly downloads, and I know many of those use the latest TS version.
I switched over to a smaller side project that was easier to test things on (and to produce those logs I posted), where it is also easy to switch between TS 4 and TS 5.
There, I can't reproduce the issue on TS 4 and plugin 4.2.3 - a whitespace change to my tsconfig
file there does reload the TS server (I see the errors in a TS file I've produced to test flash for a second) but it comes back immediately. So it does seem like this is probably more of an issue with TS 5 than it is with WebStorm?
Unfortunately, in the main project i was posting about originally, downgrading to TS 4 isn't a realistic option...
Thanks for trying to create a reproduction, I appreciate the effort. As you can imagine, it makes debugging significantly (even infinitely) easier.
Could you try a release like these?
5.1.3 seems to work: microsoft/TypeScript#55673 (comment)
I didn't bother trying 5.0.4
since 5.1.3
worked, but lmk if you want me to. (I've spent most of my work day on debugging this slowly but I could try tomorrow if so 😛)
No, that's plenty - thanks! Let's see if the TS team has any thoughts.