-
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
TypeScriptCodeFixProvider encountered an error and has been disabled #17486
Comments
The stack suggests that the JSON returned by TSServer in response to the request for code fixes ( I'm guessing that the error is reported as being on line 2 because the content on line 1 (in a 1-based system?) is unterminated and end-of-stream is the first place we can conclude that it never will be. Otherwise, I can't explain it because I'm pretty sure all of our requests and responses occupy a single line. |
Assuming that this is a problem with the JSON itself (rather than its contents), this is unlikely to be fixed by the hardening we've recently done in our deserialization code. |
We don't support very many code fixes in 15.3, so it seems unlikely that the message was truncated for being too long. A TSServer crash seems like a more plausible explanation. @NoelAbrahams, do you have an event log entry indicating a crash in node.exe? |
@amcasey, sorry for the delay. No there is nothing in the logs for |
@NoelAbrahams are you able to reproduce the issue? I tried poking around with the code you provided but didn't have any problems. Even if you can't reproduce it deterministically, have you seen it more than once? |
@amcasey, I am able to reproduce it deterministically via the following bit of code: namespace foo {
function
class Foo {
}
} It does not reproduce without the |
Thanks, @NoelAbrahams, that's a big help! I tried it on our latest build and had no issues, so it might already be fixed. I'll confirm that I can repro it in an older build to ensure that I'm not just missing something. |
@NoelAbrahams, I installed 15.3P3 and TS2.4, but was unable to repro the issue. Would you mind trying to grab a TSServer trace of the issue? https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29#logging TL;DR: Create a directory like Thanks! |
@amcasey, here is the output from the The following bit was added to the head (line 0, position 0) of file namespace foo {
function
class Foo {
}
} I'm not able to send the verbose logging as it contains details on all files in our project system. I hope this is sufficient. If not let me know.
|
Ah, that issue. That should be fixed by 587309d. |
Looks like that change didn't make it into 2.4, but it should be available in the next release. |
Actually, I guess there's a second issue here. While a TSServer crash is undesirable, VS is supposed to be resilient against that. Do you get anything useful when you click "Show Stack Trace" in the yellow warning bar? Update: Oh, of course that's the stack you originally filed. |
Alright, it sounds like I misunderstood our resiliency goals. We're fine with the unhandled exception here because it brings such issues to our attention. However, we'd still like to understand how a failure to process a |
Here you go... these are the only references to
|
Thanks! I'm pretty suspicious of this bit: |
Per our request, newtonsoft drops the I'd also like to understand why the null is sent. Edit: The bit about newtonsoft dropping the null is inaccurate - it actually gets consumed by another call - but the effect is the same. |
The parsing/deserialization fix is straightforward and should be available in a future release of VS. That leaves how the server could have sent |
For anyone reviewing this issue, the repro requires I can hit the reported issue without seeing the documentHighlights-full exception, so the two issues are probably unrelated. |
The |
Impressive 👍 |
TypeScript Version: 2.4.0
Visual Studio: 15.3.0 Preview 3.0
Visual Studio printed this error in a header.
I believe the error was triggered by the following bit of code:
The text was updated successfully, but these errors were encountered: