Skip to content
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

Including this plugin in WebStorm projects breaks TS type checking #243

Closed
ekilah opened this issue Oct 19, 2023 · 10 comments
Closed

Including this plugin in WebStorm projects breaks TS type checking #243

ekilah opened this issue Oct 19, 2023 · 10 comments
Assignees

Comments

@ekilah
Copy link
Contributor

ekilah commented Oct 19, 2023

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

image
image

With it enabled:

image
image

  • 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.

@ekilah
Copy link
Contributor Author

ekilah commented Oct 19, 2023

the same problem appears to happen on this plugin's relatively newly released 5.0.2, no change.

@mrmckeb
Copy link
Owner

mrmckeb commented Oct 23, 2023

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

@mrmckeb mrmckeb self-assigned this Oct 23, 2023
@ekilah
Copy link
Contributor Author

ekilah commented Oct 23, 2023

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?

@ekilah
Copy link
Contributor Author

ekilah commented Oct 23, 2023

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"

@mrmckeb
Copy link
Owner

mrmckeb commented Oct 24, 2023

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.

@ekilah
Copy link
Contributor Author

ekilah commented Oct 24, 2023

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...

@mrmckeb
Copy link
Owner

mrmckeb commented Oct 24, 2023

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?

@ekilah
Copy link
Contributor Author

ekilah commented Oct 24, 2023

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 😛)

@mrmckeb
Copy link
Owner

mrmckeb commented Oct 24, 2023

No, that's plenty - thanks! Let's see if the TS team has any thoughts.

@mrmckeb
Copy link
Owner

mrmckeb commented Feb 11, 2024

Closed by #244 for now. We'll reopen if the TS team think there are changes we can make in future. Thanks again!

@mrmckeb mrmckeb closed this as completed Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants