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

TSServer outputs NPM warnings at startup #19660

Closed
micbou opened this issue Nov 1, 2017 · 2 comments · Fixed by #19663
Closed

TSServer outputs NPM warnings at startup #19660

micbou opened this issue Nov 1, 2017 · 2 comments · Fixed by #19663
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@micbou
Copy link
Contributor

micbou commented Nov 1, 2017

Since TypeScript 2.6.1, TSServer outputs NPM warnings at startup (see actual behavior below). That's problematic since clients expect HTTP-like responses from TSServer stdout.

TypeScript Version: 2.7.0-dev.20171101

Steps to reproduce

npm -g install typescript@next
tsserver

Expected behavior:

No output.

Actual behavior:

The following lines are printed:

npm WARN 2.7 No description
npm WARN 2.7 No repository field.
npm WARN 2.7 No license field.
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Nov 1, 2017
@mhegazy mhegazy added this to the TypeScript 2.7 milestone Nov 1, 2017
@mhegazy mhegazy assigned ghost Nov 1, 2017
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Nov 1, 2017
@ghost ghost closed this as completed in #19663 Nov 1, 2017
@ghost
Copy link

ghost commented Nov 1, 2017

@micbou Check out typescript@next tomorrow and tell us if this is fixed for you. (You may have to clear your typings cache first.)

@micbou
Copy link
Contributor Author

micbou commented Nov 2, 2017

I tried with TypeScript 2.7.0-dev.20171102 (I first deleted the ~/.cache/typescript folder) and I am still getting the NPM warnings although the content of package.json in ~/.cache/typescript/2.7 is

{ "description": "", "repository": "", "license": "" }

zzbot added a commit to ycm-core/ycmd that referenced this issue Nov 3, 2017
[READY] Support TypeScript 2.6.1

TypeScript 2.6.1 introduced a bug in TSServer where NPM warnings are printed on stdout at startup:
```
npm WARN 2.6 No description
npm WARN 2.6 No repository field.
npm WARN 2.6 No license field.
```
See issue microsoft/TypeScript#19660. The TypeScript completer chokes on this output as it always expects a HTTP-like response from TSServer and assumes that the server died if not. Though it's a TSServer bug, we can handle it by catching the `ValueError` exception raised when parsing invalid headers and by interrupting the reader loop only if the server is not running.

Also, this new version of TypeScript returns an empty list when no definition is found. Update the `_GoToDefinition` and `_GoToType` functions accordingly.

Fixes ycm-core/YouCompleteMe#2818.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/869)
<!-- Reviewable:end -->
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants