Skip to content

tsserver crashes after a few minutes #539

Open

Description

I've been trying to make this plugin work for my team. I hear great things about it. Unfortunately the TS node process keeps crashing after a few minutes, and I could use some assistance to debug it.

When I first start up sublime, ps aux | grep node shows the process is started:
/usr/local/bin/node /Users/aj/Library/Application Support/Sublime Text 3/Packages/TypeScript/tsserver/tsserver.js

If I make syntax errors or try to rename things, it mostly seems to work. ps aux | grep node shows the process is still running.

After a few minutes though, it stops working. ps aux | grep node no longer shows the process running, so it seems that the TS server has died.

Looking at the sublime console, ctrl-backtick, I see the following stacktrace. There's no other error output:

Traceback (most recent call last):
  File "/Users/aj/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/listeners/idle.py", line 22, in _check_timeout_count
    self.handler()
  File "/Users/aj/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/listeners/idle.py", line 79, in on_selection_idle
    self.request_document_highlights(view, info)
  File "/Users/aj/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/listeners/idle.py", line 187, in request_document_highlights
    cli.service.async_document_highlights(view.file_name(), location, self.highlight_occurrences)
  File "/Users/aj/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/service_proxy.py", line 259, in async_document_highlights
    self.__comm.sendCmdAsync(json_str, on_completed, req_dict["seq"])
  File "/Users/aj/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/node_client.py", line 111, in sendCmdAsync
    if self.postCmd(cmd):
  File "/Users/aj/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/node_client.py", line 142, in postCmd
    self.server_proc.stdin.write(cmd.encode())
BrokenPipeError: [Errno 32] Broken pipe

This also seems to confirm that the process has died, but there's no mention of why.

Is there anything I can do to debug this? I haven't been able to find the stdout/stderr logs for the ts server to see if there is anything relevant there.

I'm not sure if it's relevant, but https://github.com/Microsoft/TypeScript-Sublime-Plugin/blob/2da61f59d231b5442e1a7136aedcb9705ad099e2/typescript/libs/node_client.py#L267 is not redirecting stderr, which might explain the lack of error output in the console?

Thanks for reading & any assistance.

Activity

  1. zhengbli commented on Oct 27, 2016

    @zhengbli
    Contributor

    Sorry for the delay. You can set an environmental variable TSS_LOG to a string value that looks like:
    "{ level: 'verbose'}" then launch sublime from the same terminal. After the editing session you will find a ".logxxx" file under Sublime Text 3\Packages\TypeScript\tsserver folder. Try to repro the issue and paste the log file here, it would help a lot.

    BTW I just drafted another release with TS 2.0 with many other fixes, which are likely solve your issue. Please try the new version after package control updates it and let us know. Thank you!

  2. SomeKittens commented on Nov 3, 2016

    @SomeKittens

    I'm on TS latest (2.0.6 as of writing this, version 2.0.1 of the Sublime plugin) and experiencing the crashes, so whatever update you were thinking of didn't fix this issue.

  3. marmotz commented on Nov 6, 2016

    @marmotz

    Same issue here.

    Zhengbo Li (@zhengbli) i tried to set TSS_LOG but there is no *.logxxx file in TypeScript\tsserver folder.
    On the other hand, there are several files *.tmpbufxx in TypeScript folder with copy of my code for each character I typed.

  4. avegancafe commented on Nov 14, 2016

    @avegancafe

    Same issue here, trying to get some logs right now will update this post when it crashes and I can find the files

  5. cindyliu-yb commented on Dec 1, 2016

    @cindyliu-yb

    have the same issue here!

  6. wildeyes commented on Mar 8, 2017

    @wildeyes

    Experiencing the same crashes here, what can be done to advance this issue towards fixing?

  7. wildeyes commented on Mar 8, 2017

    @wildeyes

    Zhengbo Li (@zhengbli) The folder you mentioned doesn't exist on Windows, where could it be?

  8. insomniac34 commented on Apr 7, 2017

    @insomniac34

    This is happening on the latest build of Sublime/TS plugin on Windows 7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions