microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.61k stars 29.03k forks source link

TypeScript server crashes frequently #46474

Closed axefrog closed 6 years ago

axefrog commented 6 years ago

I have a large-ish workspace project with between 15 and 20 workspace folders. The main two projects I'm working on are JavaScript projects with symlinked dependencies to other projects in the workspace.

Without fail, the TypeScript server will eventually crash while I am working, which prevents completion suggestions and symbol navigation from working. Sometimes it may happen in under a minute, and other times it can take over an hour (best case scenario) to crash. If I open and close the developer tools a couple of times after that, VSCode will then crash also. I've tried all logging levels, I've tried disabling extensions to figure out which one is the culprit (if any), and cannot find any clear source for the problem.

I'd be happy to provide any other details or logs you would like to see, but to start, here is a copy of the latest TS Server crash log:

Info 0    [8:44:25.602] Starting TS Server
Info 1    [8:44:25.603] Version: 2.7.2
Info 2    [8:44:25.603] Arguments: C:\Program Files (x86)\Microsoft VS Code\Code.exe c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName C:\Users\axefr\AppData\Local\Temp\vscode-tscancellation-616894cd52615b036c91.sock* --logVerbosity verbose --logFile C:\Users\axefr\AppData\Roaming\Code\logs\20180325T083155\vscode.typescript-language-features_1\tsserver-log-gOcs0W\tsserver.log --locale en
Info 3    [8:44:25.604] Platform: win32 NodeVersion: 7 CaseSensitive: false
Info 4    [8:44:25.606] Provided types map file "c:/Program Files (x86)/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/tsserver.js/../typesMap.json" doesn't exist
Info 5    [8:44:25.607] Binding...
Info 6    [8:44:25.617] event:
    {"seq":0,"type":"event","event":"typingsInstallerPid","body":{"pid":16476}}
Info 7    [8:44:25.618] request:
    {"seq":0,"type":"request","command":"configure","arguments":{"hostInfo":"vscode"}}
Info 8    [8:44:25.619] Host information vscode
Info 9    [8:44:25.619] response:
    {"seq":0,"type":"response","command":"configure","request_seq":0,"success":true}
Perf 10   [8:44:25.620] 0::configure: async elapsed time (in milliseconds) 1.0414
Info 11   [8:44:25.620] request:
    {"seq":1,"type":"request","command":"compilerOptionsForInferredProjects","arguments":{"options":{"module":"commonjs","target":"es2016","jsx":"preserve","allowJs":true,"allowSyntheticDefaultImports":true,"allowNonTsExtensions":true}}}
Info 12   [8:44:25.622] Scheduled: *refreshInferredProjects*
Perf 13   [8:44:25.622] 1::compilerOptionsForInferredProjects: elapsed time (in milliseconds) 1.6799
Info 14   [8:44:25.622] response:
    {"seq":0,"type":"response","command":"compilerOptionsForInferredProjects","request_seq":1,"success":true,"body":true}
Info 15   [8:44:25.623] request:
    {"seq":2,"type":"request","command":"geterr","arguments":{"delay":0,"files":["d:/Dropbox/Work/Dev/frptools/projects/salix/packages/core/src/core/helpers/props.js","d:/Dropbox/Work/Dev/frptools/projects/salix/packages/web/src/dom/node/HtmlNode.js"]}}
Err 16    [8:44:25.635] Exception on executing command delayed processing of request 2:

    Cannot read property 'isOrphan' of undefined

    TypeError: Cannot read property 'isOrphan' of undefined
    at ProjectService.getDefaultProjectForFile (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:87551:63)
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:90165:74
    at Object.mapDefined (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:1777:30)
    at IOSession.Session.createCheckList (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:90163:27)
    at IOSession.Session.getDiagnostics (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:90170:38)
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:89217:82
    at MultistepOperation.executeAction (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:88989:25)
    at MultistepOperation.startNew (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:88954:22)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:89217:42)
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:90553:88
    at IOSession.Session.executeWithRequestId (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:90544:28)
    at IOSession.Session.executeCommand (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:90553:33)
    at IOSession.Session.onMessage (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:90573:35)
    at Interface.<anonymous> (c:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:91774:27)
    at emitOne (events.js:96:13)
    at Interface.emit (events.js:191:7)
    at Interface._onLine (readline.js:241:10)
    at Interface._normalWrite (readline.js:384:12)
    at Socket.ondata (readline.js:101:10)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20)
Info 17   [8:44:25.635] event:
    {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":2}}
Perf 18   [8:44:25.636] 2::geterr: async elapsed time (in milliseconds) 13.1011
Info 19   [8:44:25.872] Running: *refreshInferredProjects*
Info 20   [8:44:25.872] refreshInferredProjects: updating project structure from ...
Info 21   [8:44:25.873] Open files: 
Info 21   [8:44:25.873] refreshInferredProjects: updated project structure ...
Info 22   [8:44:25.873] Open files: 
Info 22   [8:44:25.873] got projects updated in background, updating diagnostics for 

Does this issue occur when all extensions are disabled?: Yes

vscodebot[bot] commented 6 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

mjbvz commented 6 years ago

Likely duplicate of https://github.com/Microsoft/TypeScript/issues/21738

Please test in the current vscode insiders which includes TypeScript 2.8 and let me know if you still hit this issue