-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
strictFunctionTypes on a large type with higher-order functions causes tsserver to hang with "Loading..." in VS Code #30449
Comments
Trace output:
The notable line is toward the bottom:
|
Here's the log file output:
|
I updated the title and description with a more specific issue that I was able to reproduce in a new empty project. I discovered that the problem is related to the strictFunctionTypes option (I disabled each option in my tsconfig.json until I discovered this was the problem). |
As of our latest builds, our perf in the given example seems fine. It was probably fixed up by one of our perf adjustments targeted at |
For context: Locally, the longest response time I recorded was 800ms for initial project open, after which subsequent operations were mostly sub-ms, excepting edits which were around 10-20ms, and the quick info at one location, the usage of |
TypeScript Version: 3.4.0-dev.20190316
Search Terms: loading, stuck
Code
I tried to create an array which represented the full key type ofJSX.IntrinsicElements
.I ended up being able to narrow down the issue to this case. If I simply specify the type alias for the key type, and export an array of that type, then import it in another module, that triggers this issue.The case that I had was insufficient. I assumed the above was the issue based on looking at my code, but I was able to narrow it down to the below case, only with strictFunctionTypes turned on. I'm working on a styled-components clone, and I've started specifying the base API. I was not able to reproduce this with a case simpler than this. It seems that JSX.IntrinsicElements is a large enough interface that it overloads the tsserver. The resulting
Styled
type contains higher-order functions that I'm assuming are too complex to analyze with strictFunctionTypes turned on.These are the things I tried, all of which cause tsserver to behave normally:
DomKey
withstring
JSX.IntrinsicElements
with a smaller interfacecreateNew
function and replaceStyled
withStyledFactories
Interpolation
withstring
.Expected behavior:
I am able to get proper IDE integration: mouse-over info, auto-complete, errors/warnings, etc.
Actual behavior:
Absolutely nothing. When I mouse over something, it shows a box with the text "Loading..." instead of info about the element under the cursor.
I turned on verbose logging and trace. I'll post each of those in a comment.
Playground Link: React is required to reproduce this issue
Related Issues:
The text was updated successfully, but these errors were encountered: