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

TS functionality keeps dying on large project #44951

Closed
Abdelhady opened this issue Jun 9, 2021 · 23 comments
Closed

TS functionality keeps dying on large project #44951

Abdelhady opened this issue Jun 9, 2021 · 23 comments
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@Abdelhady
Copy link

Issue Type: Bug

VSCode keeps trying to "Initializing JS/TS language features", but fails consistently

I'm working on a large backend typescript project in Amazon though

VS Code version: Code 1.56.2 (054a9295330880ed74ceaedda236253b4f39a335, 2021-05-12T17:44:30.902Z)
OS version: Darwin x64 19.6.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz (4 x 2500)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 12, 15, 23
Memory (System) 16.00GB (0.27GB free)
Process Argv --crash-reporter-id ff3e41e0-a3a4-4dad-a1e8-0e6d71d3b908
Screen Reader no
VM 0%
Extensions (8)
Extension Author (truncated) Version
Bookmarks ale 13.0.4
gitlens eam 11.4.1
vscode-graphql Gra 0.3.16
dotenv mik 1.0.1
vscode-docker ms- 1.13.0
remote-containers ms- 0.177.2
sqltools mtx 0.23.0
sqltools-driver-pg mtx 0.2.0
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
vspre833cf:30267465
pythonptprofiler:30281270
vshan820:30294714
pythondataviewer:30285071
vscus158cf:30286554
vscgsv2:30307504
vscorehov:30309549
vscod805:30301674
binariesv517:30312825

@vscodebot
Copy link

vscodebot bot commented Jun 9, 2021

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

@mjbvz mjbvz self-assigned this Jun 9, 2021
@mjbvz
Copy link
Contributor

mjbvz commented Jun 9, 2021

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

@Abdelhady
Copy link
Author

I have the latest version 1.56.2 .. will disable all extensions and give it a try

@mjbvz
Copy link
Contributor

mjbvz commented Jun 9, 2021

Please test using the insiders version: 1.57

@Abdelhady
Copy link
Author

I've just tried insiders version 1.57, with no extensions installed,
I'm experiencing the same issue, specially when I have both TS & JS files opened, even if only one of each kind is opened.

fyi, may be I started experiencing this heavily this week only .. don't remember exactly when though!

@mjbvz
Copy link
Contributor

mjbvz commented Jun 10, 2021

Please try collecting the TS Server log from the crashed instance:

  1. Set "typescript.tsserver.log": "verbose"

  2. Restart VS Code and reproduce the problem

  3. Open the TypeScript section of the output panel

  4. At the very top, find the first line that prints to path to the semantic error log file. It should look something like:

    [Info  - 19:54:59.247] <semantic> Log file: /Users/matb/Library/Application Support/Code - Insiders/logs/20200213T104930/exthost55/vscode.typescript-language-features/tsserver-log-ZT2zau/tsserver.log
    

    That file contains the typescript logs.

Look through that log file for the first error or stack trace you see. If you can share the log, I can also take a look to see if anything stands out

⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

@Abdelhady
Copy link
Author

Well, TSServer keeps exiting periodically with rolling over to a new log file each time as follows:

Typescript Output
[Info  - 16:02:16.118] Starting TS Server 
[Info  - 16:02:16.119] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:02:16.121] <syntax> Forking...
[Info  - 16:02:16.132] <syntax> Starting...
[Info  - 16:02:16.138] <semantic> Forking...
[Info  - 16:02:16.196] <semantic> Starting...
[Info  - 16:04:30.124] Killing TS Server
[Info  - 16:04:30.124] Starting TS Server 
[Info  - 16:04:30.124] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:04:30.134] <syntax> Forking...
[Info  - 16:04:30.143] <syntax> Starting...
[Info  - 16:04:30.144] <semantic> Forking...
[Info  - 16:04:30.175] <semantic> Starting...
[Info  - 16:04:30.193] Killing TS Server
[Info  - 16:04:30.193] Starting TS Server 
[Info  - 16:04:30.193] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:04:30.195] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-hD2Xke/tsserver.log
[Info  - 16:04:30.195] <syntax> Forking...
[Info  - 16:04:30.201] <syntax> Starting...
[Info  - 16:04:30.202] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-zadtNG/tsserver.log
[Info  - 16:04:30.202] <semantic> Forking...
[Info  - 16:04:30.209] <semantic> Starting...
[Info  - 16:10:35.983] TSServer exited
[Info  - 16:10:35.983] TSServer log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-zadtNG/tsserver.log
[Info  - 16:10:38.47] Starting TS Server 
[Info  - 16:10:38.47] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:10:38.57] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-LM6H99/tsserver.log
[Info  - 16:10:38.57] <syntax> Forking...
[Info  - 16:10:38.65] <syntax> Starting...
[Info  - 16:10:38.67] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-3aujZw/tsserver.log
[Info  - 16:10:38.68] <semantic> Forking...
[Info  - 16:10:38.86] <semantic> Starting...
[Info  - 16:44:47.603] TSServer exited
[Info  - 16:44:47.603] TSServer log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-3aujZw/tsserver.log
[Info  - 16:44:47.603] Starting TS Server 
[Info  - 16:44:47.603] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:44:47.610] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-9uKvUA/tsserver.log
[Info  - 16:44:47.610] <syntax> Forking...
[Info  - 16:44:47.616] <syntax> Starting...
[Info  - 16:44:47.618] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-ZpGVAl/tsserver.log
[Info  - 16:44:47.619] <semantic> Forking...
[Info  - 16:44:47.645] <semantic> Starting...
[Info  - 16:47:08.582] TSServer exited
[Info  - 16:47:08.582] TSServer log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-ZpGVAl/tsserver.log
[Info  - 16:47:08.582] Starting TS Server 
[Info  - 16:47:08.582] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:47:08.584] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-q47TeG/tsserver.log
[Info  - 16:47:08.584] <syntax> Forking...
[Info  - 16:47:08.592] <syntax> Starting...
[Info  - 16:47:08.593] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-xQMKrh/tsserver.log
[Info  - 16:47:08.593] <semantic> Forking...
[Info  - 16:47:08.607] <semantic> Starting...
[Info  - 16:49:51.89] TSServer exited
[Info  - 16:49:51.89] TSServer log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-xQMKrh/tsserver.log
[Info  - 16:49:51.89] Starting TS Server 
[Info  - 16:49:51.89] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:49:51.91] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-reiduR/tsserver.log
[Info  - 16:49:51.91] <syntax> Forking...
[Info  - 16:49:51.98] <syntax> Starting...
[Info  - 16:49:51.99] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-ttZwsl/tsserver.log
[Info  - 16:49:51.99] <semantic> Forking...
[Info  - 16:49:51.110] <semantic> Starting...
[Info  - 16:53:18.146] TSServer exited
[Info  - 16:53:18.146] TSServer log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-ttZwsl/tsserver.log
[Info  - 16:53:18.147] Starting TS Server 
[Info  - 16:53:18.147] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:53:18.151] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-kB2UL6/tsserver.log
[Info  - 16:53:18.151] <syntax> Forking...
[Info  - 16:53:18.162] <syntax> Starting...
[Info  - 16:53:18.167] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-lAMB9t/tsserver.log
[Info  - 16:53:18.167] <semantic> Forking...
[Info  - 16:53:18.202] <semantic> Starting...
[Info  - 16:55:59.495] TSServer exited
[Info  - 16:55:59.495] TSServer log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-lAMB9t/tsserver.log
[Info  - 16:55:59.495] Starting TS Server 
[Info  - 16:55:59.495] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:55:59.500] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-whPqdJ/tsserver.log
[Info  - 16:55:59.500] <syntax> Forking...
[Info  - 16:55:59.506] <syntax> Starting...
[Info  - 16:55:59.510] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-NG2Lg5/tsserver.log
[Info  - 16:55:59.510] <semantic> Forking...
[Info  - 16:55:59.527] <semantic> Starting...
[Info  - 16:59:11.117] TSServer exited
[Info  - 16:59:11.117] TSServer log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-NG2Lg5/tsserver.log
[Info  - 16:59:11.121] Starting TS Server 
[Info  - 16:59:11.121] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:59:11.124] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-SIG1Bj/tsserver.log
[Info  - 16:59:11.124] <syntax> Forking...
[Info  - 16:59:11.131] <syntax> Starting...
[Info  - 16:59:11.132] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-e6nCHU/tsserver.log
[Info  - 16:59:11.132] <semantic> Forking...
[Info  - 16:59:11.148] <semantic> Starting...
[Info  - 17:02:35.234] TSServer exited
[Info  - 17:02:35.234] TSServer log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-e6nCHU/tsserver.log
[Info  - 17:02:35.235] Starting TS Server 
[Info  - 17:02:35.235] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 17:02:35.248] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-P4STrc/tsserver.log
[Info  - 17:02:35.248] <syntax> Forking...
[Info  - 17:02:35.264] <syntax> Starting...
[Info  - 17:02:35.266] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-8uiAlR/tsserver.log
[Info  - 17:02:35.266] <semantic> Forking...
[Info  - 17:02:35.305] <semantic> Starting...
[Info  - 17:06:44.548] TSServer exited
[Info  - 17:06:44.548] TSServer log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-8uiAlR/tsserver.log
[Info  - 17:06:44.548] Starting TS Server 
[Info  - 17:06:44.548] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 17:06:44.563] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-qlhzEl/tsserver.log
[Info  - 17:06:44.563] <syntax> Forking...
[Info  - 17:06:44.575] <syntax> Starting...
[Info  - 17:06:44.577] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-D2UHQs/tsserver.log
[Info  - 17:06:44.577] <semantic> Forking...
[Info  - 17:06:44.581] <semantic> Starting...
[Info  - 17:09:56.60] TSServer exited
[Info  - 17:09:56.60] TSServer log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-D2UHQs/tsserver.log
[Info  - 17:09:56.60] Starting TS Server 
[Info  - 17:09:56.60] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 17:09:56.66] <syntax> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-OGVXZw/tsserver.log
[Info  - 17:09:56.66] <syntax> Forking...
[Info  - 17:09:56.75] <syntax> Starting...
[Info  - 17:09:56.76] <semantic> Log file: /Users/my_user_name/Library/Application Support/Code - Insiders/logs/20210610T180209/exthost1/vscode.typescript-language-features/tsserver-log-I9cyZn/tsserver.log
[Info  - 17:09:56.76] <semantic> Forking...
[Info  - 17:09:56.95] <semantic> Starting...

The very first log file didn't have any err in it, but generally each file of them has slightly over 160k+ lines

The 2nd log file, kept showing this err throughout the whole file, until it exited and rolled over to another log file

Error
Err 15    [18:10:39.550] Could not find file "full_file_path_for_currently_opened_file".
All files are: []
Err 16    [18:10:39.583] Could not find file "full_file_path_for_currently_opened_file".
All files are: []
Err 17    [18:10:39.583] Exception on executing command {"seq":2,"type":"request","command":"projectInfo","arguments":{"file":"full_file_path_for_currently_opened_file","needFileNameList":false}}:

    No Project.

    Error: No Project.
        at Object.ThrowNoProject (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:156260:23)
        at ProjectService.doEnsureDefaultProjectForFile (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:160037:131)
        at ProjectService.ensureDefaultProjectForFile (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:160032:75)
        at IOSession.Session.getFileAndProjectWorker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:164393:87)
        at IOSession.Session.getProjectInfoWorker (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:164238:36)
        at IOSession.Session.getProjectInfo (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:164235:29)
        at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:163534:61)
        at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165205:88
        at IOSession.Session.executeWithRequestId (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165196:28)
        at IOSession.Session.executeCommand (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165205:33)
        at IOSession.Session.onMessage (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165231:35)
        at Interface.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:167833:31)
        at Interface.emit (events.js:315:20)
        at Interface._onLine (readline.js:337:10)
        at Interface._normalWrite (readline.js:482:12)
        at Socket.ondata (readline.js:194:10)
        at Socket.emit (events.js:315:20)
        at addChunk (internal/streams/readable.js:309:12)
        at readableAddChunk (internal/streams/readable.js:284:9)
        at Socket.Readable.push (internal/streams/readable.js:223:10)
        at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

and of course the full_file_path_for_currently_opened_file file was there in my file system the whole time

I checked 2 random remaining files, but they didn't have any err in them

Let's also notice that this whole case happens when my RAM is full or near full

I really hope this would help .. and thanks a lot for following up on this
anything else I can help with, just please tell me

@mjbvz
Copy link
Contributor

mjbvz commented Jun 11, 2021

Hm, do you see this for every project you open or just one of them in particular?

I'm going to add some extra logging to also see if some kind of out of memory issue is causing this

@mjbvz
Copy link
Contributor

mjbvz commented Jun 11, 2021

The next insiders build will also log the exit signal for the server process. Hopefully that helps us track down what is going on

mjbvz referenced this issue in microsoft/vscode Jun 11, 2021
@Abdelhady
Copy link
Author

About your question .. I'm working only on one Typescript project (backend one) for quite a while now .. so, I can't tell if other Typescript projects would work well or not .. but other javascript projects are working fine with me though.

@mjbvz
Copy link
Contributor

mjbvz commented Jun 15, 2021

Did you have a chance to test using the most recent insiders build? It should print more info when the server exits

@Abdelhady
Copy link
Author

Abdelhady commented Jun 22, 2021

Sorry for being late,

well, in a single log file, I can see about 15 occurrences for loading the global typescript-vscode-sh-plugin plugin .. I'm not sure if this is normal or not

Plugin loading part
Info 3742 [18:27:45.185] Loading global plugin typescript-vscode-sh-plugin
Info 3743 [18:27:45.185] Enabling plugin typescript-vscode-sh-plugin from candidate paths: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features,/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js/../../..
Info 3744 [18:27:45.186] Loading typescript-vscode-sh-plugin from /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features (resolved to /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/node_modules)
Info 3745 [18:27:45.195] typescript-vscode-sh-plugin active for version < 4.2 and JS/JSX files. Current version : 4.3.2
Info 3746 [18:27:45.195] Intercepting getEncodedSemanticClassifications and getEncodedSyntacticClassifications.
Info 3747 [18:27:45.195] Plugin validation succeeded

About the TSServer exited message itself .. Let's take an example of this part of the output:

[Info  - 16:36:20.593] <syntax> Forking...
[Info  - 16:36:20.604] <syntax> Starting...
[Info  - 16:36:20.606] <semantic> Log file: /Users/my_user/Library/Application Support/Code - Insiders/logs/20210621T190045/exthost1/vscode.typescript-language-features/tsserver-log-SpwGYc/tsserver.log
[Info  - 16:36:20.606] <semantic> Forking...
[Info  - 16:36:20.613] <semantic> Starting...
[Info  - 16:38:46.472] TSServer exited. Signal: SIGABRT
[Info  - 16:38:46.472] TSServer log file: /Users/my_user/Library/Application Support/Code - Insiders/logs/20210621T190045/exthost1/vscode.typescript-language-features/tsserver-log-SpwGYc/tsserver.log
[Info  - 16:38:46.474] Starting TS Server 
[Info  - 16:38:46.474] Using tsserver from: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info  - 16:38:46.477] <syntax> Log file: /Users/my_user/Library/Application Support/Code - Insiders/logs/20210621T190045/exthost1/vscode.typescript-language-features/tsserver-log-dhtyot/tsserver.log

The first file named /tsserver-log-SpwGYc/tsserver.log just ended with the following:
(I replaced actual file paths for privacy purposes)

Info 3737 [18:38:04.278] -----------------------------------------------
Info 3738 [18:38:04.292] event:
    {"seq":0,"type":"event","event":"projectLoadingFinish","body":{"projectName":"/Users/path_to_file/tsconfig.json"}}
Info 3739 [18:38:04.294] event:
    {"seq":0,"type":"event","event":"telemetry","body":{"telemetryEventName":"projectInfo","payload":{"projectId":"0fcd9ae24a9a8d62221db465921f834fc91864bc98d0c506518c72367d56aca9","fileStats":{"js":0,"jsSize":0,"jsx":0,"jsxSize":0,"ts":777,"tsSize":2003306,"tsx":0,"tsxSize":0,"dts":1203,"dtsSize":28813933,"deferred":0,"deferredSize":0},"compilerOptions":{"composite":true,"target":"es2019","module":"commonjs","moduleResolution":"node","esModuleInterop":true,"downlevelIteration":true,"allowJs":false,"strict":true,"noEmit":false,"noEmitOnError":true,"noErrorTruncation":true,"noImplicitAny":true,"noImplicitThis":true,"noImplicitUseStrict":false,"noResolve":false,"noStrictGenericChecks":false,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"isolatedModules":false,"inlineSourceMap":true,"inlineSources":true,"sourceMap":false,"experimentalDecorators":true,"emitDecoratorMetadata":true,"forceConsistentCasingInFileNames":true,"rootDir":"","baseUrl":"","outDir":"","paths":""},"typeAcquisition":{"enable":false,"include":false,"exclude":false},"extends":true,"files":false,"include":false,"exclude":true,"compileOnSave":false,"configFileName":"tsconfig.json","projectType":"configured","languageServiceEnabled":true,"version":"4.3.2"}}}
Info 3740 [18:38:04.294] Creating configuration project /Users/path_to_file/tsconfig.json
Info 3741 [18:38:04.294] event:
    {"seq":0,"type":"event","event":"projectLoadingStart","body":{"projectName":"/Users/path_to_file/tsconfig.json","reason":"Creating project referenced in solution /Users/path_to_file/tsconfig.json to find possible configured project for /Users/path_to_file/js_file.js to open"}}
Info 3742 [18:38:04.294] Loading global plugin typescript-vscode-sh-plugin
Info 3743 [18:38:04.294] Enabling plugin typescript-vscode-sh-plugin from candidate paths: /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features,/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js/../../..
Info 3744 [18:38:04.294] Loading typescript-vscode-sh-plugin from /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features (resolved to /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/node_modules)
Info 3745 [18:38:04.295] typescript-vscode-sh-plugin active for version < 4.2 and JS/JSX files. Current version : 4.3.2
Info 3746 [18:38:04.296] Intercepting getEncodedSemanticClassifications and getEncodedSyntacticClassifications.
Info 3747 [18:38:04.296] Plugin validation succeeded
Info 3748 [18:38:04.296] FileWatcher:: Added:: WatchInfo: /Users/path_to_file/index.ts 500 undefined WatchType: Closed Script info
Info 3749 [18:38:04.318] Starting updateGraphWorker: Project: /Users/path_to_file/tsconfig.json
Info 3750 [18:38:04.369] DirectoryWatcher:: Added:: WatchInfo: /Users/path_to_file/node_modules 1 undefined Project: /Users/path_to_file/tsconfig.json WatchType: Failed Lookup Locations
Info 3751 [18:38:04.371] Elapsed:: 1.6069939732551575ms DirectoryWatcher:: Added:: WatchInfo: /Users/path_to_file/node_modules 1 undefined Project: /Users/path_to_file/tsconfig.json WatchType: Failed Lookup Locations

and the one after it called /tsserver-log-dhtyot/tsserver.log, just started with:

Info 0    [18:38:47.114] Starting TS Server
Info 1    [18:38:47.115] Version: 4.3.2
Info 2    [18:38:47.115] Arguments: .......

@mjbvz
Copy link
Contributor

mjbvz commented Jul 1, 2021

Is this a very large project? SIGABRT suggests that the server process may be running out of memory. You can also try configuring typescript.tsserver.maxTsServerMemory

@Abdelhady
Copy link
Author

Yes it is a very large project indeed, and we are separating it into different packages with utilizing project references as recommended,

I tried to increase the maxTsServerMemory from its default 3072 to 5120, but issue still there most of the time!

I could have increased it more than that, but I have only 16 GB, and I still need Docker and browser and other stuff, where it might not be practical to increase it more than that I guess.

@mjbvz
Copy link
Contributor

mjbvz commented Jul 8, 2021

Can you also try some of the recommendation listed in https://code.visualstudio.com/docs/typescript/typescript-compiling#_working-with-large-projects

Transferring to TS for further investigation about why it may be using so much memory

@mjbvz mjbvz transferred this issue from microsoft/vscode Jul 8, 2021
@mjbvz mjbvz removed their assignment Jul 8, 2021
@mjbvz mjbvz changed the title TS functionality keeps dying TS functionality keeps dying on large project Jul 8, 2021
@RyanCavanaugh RyanCavanaugh added the Needs More Info The issue still hasn't been fully clarified label Jul 13, 2021
@Abdelhady
Copy link
Author

I noticed also something ..

even with the default maxTsServerMemory, I can work normally without having this issue until I open a JS file,

Opening one JS file, no matter how small it is, it will make it highly likely for VSCode to have this issue.

@byron70
Copy link

byron70 commented Nov 24, 2021

I was having this very similar issue in a remote devcontainer setup with docker on a somewhat larger project. I changed this setting "typescript.tsserver.maxTsServerMemory": 8000 from the default and it seemed to help a bit, and it doesn't appear the tsserver process uses anywhere near that amount. The container only seems to report about 2GB of usage and top (in the container) shows usage at 40% for the tsserver process, so maybe really using around 1GB, which seems excessive.

@chrisvdp
Copy link

I am having the same issue with a large monorepo that I am working in. For context, our root tsconfig.json has about 110 references.

I have tried opening the project in the latest insider build with no extensions and see the same thing. When I opened it in insiders I did get a macOS crash report for an electron SIGABRT. I can send it to possibly @RyanCavanaugh.

System Info Version: 1.66.0-insider (Universal) Commit: db0525f Date: 2022-03-17T05:18:05.656Z Electron: 17.1.1 Chromium: 98.0.4758.109 Node.js: 16.13.0 V8: 9.8.177.11-electron.0 OS: Darwin arm64 21.4.0

@Pickleboyonline
Copy link

Same issue here with a very large project. I have the same issue @Abdelhady has, when I open a JS file it increases the chance of the infinite TS server restarting to occur.

@valentinbeggi
Copy link

Same issue here, typescript goes out of memory on a multi package monorepo.
Event when increasing memory to 8gb Typescript will eventually die.
Project references are correctly used.. 🥲

@zen0wu
Copy link

zen0wu commented Jan 29, 2023

I stumped on this problem and I believe the root cause is here: microsoft/vscode#127105

It has nothing to do with TypeScript but rather vscode is running tsserver with an inherent memory from electron and it cannot be changed 😠

@Pokruk
Copy link

Pokruk commented Sep 15, 2023

I stumped on this problem and I believe the root cause is here: microsoft/vscode#127105

It has nothing to do with TypeScript but rather vscode is running tsserver with an inherent memory from electron and it cannot be changed 😠

Why is this issue still open if the problem is just the vscode and not the ts itself, lol

@RyanCavanaugh
Copy link
Member

We implemented microsoft/vscode#191019 so you can now run tsserver under node, which has effectively unlimited memory if provided the right flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

9 participants