microsoft / microsoft/TypeScript-Sublime-Plugin

tsserver crashes after a few minutes

Offen
#539 9 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
JavaScript
Sterne
1.7k
Forks
236
Ø Merge
21 T. 13 Std.
Gemergte PRs (30 T.)
1

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit typescript/libs/node_client.py, insbesondere mit postCmd und der im Bericht erwähnten stderr-Behandlung, und verfolge dann den aus tsserver/tsserver.js gestarteten tsserver-Prozess weiter. Reproduziere den verzögerten Absturz und erfasse die Diagnoseausgabe des Servers; abgeschlossen ist die Aufgabe, wenn du identifiziert hast, warum der Prozess beendet wird, und den relevanten Fehlerpfad dokumentierst oder behebst.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
node.js, python, typescript
Bereich
developer-experience, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.