Still crashing TS Language Server
We fixed this bug in TypeScript 5.7. You can keep using older versions to compile your project but you'll need to make sure VS Code is using 5.7+ for IntelliSense
Originally posted by @mjbvz in #235339
I'm on the latest version of vscode insiders, github chat, and typescript. It still crashes every few minutes and requires restarting vscode completely.
Error message: The JS/TS language service crashed. This may be caused by a plugin contributed by one of these extensions: GitHub.copilot-chat. Please try disabling these extensions before filing an issue against VS Code.
VScode version: 1.97.0-insider Typescript version: 5.7.3
Please try collecting the TS Server log from the crashed instance:
-
Set
"typescript.tsserver.log": "verbose" -
Restart VS Code and reproduce the problem
-
Open the
TypeScriptsection of the output panel -
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.logThat 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
Not sure why but it hasn't crashed since I enabled the log. I disabled the log and it starts crashing again. I'll just leave the log enabled . Thanks!
Re-opening cause this is still happening, every 5-10 minutes the language server crashes and requires turning vscode off an on again. Turning the logs on worked for a little bit before but it came back. Any ideas why this keeps happening? There are tickets going back to June last year talking about this
@mjbvz the log is over 80000 lines, where do I look in there, or is there something I can search on "error" is used for other things so not a viable search candidate
@mjbvz found one exception that might be related:
Err 1011 [08:11:27.101] Exception on executing command _.copilot.installPingHandler:
Protocol handler already exists for command "_.copilot.ping"
Error: Protocol handler already exists for command "_.copilot.ping"
at IpcIOSession.addProtocolHandler (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:195200:13)
at Object.a [as create] (c:\Users\jnorris\.vscode-insiders\extensions\github.copilot-chat-0.25.2025022401\node_modules\@vscode\copilot-typescript-server-plugin\dist\main.js:2:21419)
at InferredProject2.enableProxy (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:186975:34)
at _ProjectService.endEnablePlugin (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:191565:15)
at _ProjectService.requestEnablePlugin (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:191543:10)
at InferredProject2.enablePlugin (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:186957:25)
at InferredProject2.enableGlobalPlugins (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:186953:12)
at new InferredProject2 (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:187199:10)
at _ProjectService.createInferredProject (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:190000:21)
at _ProjectService.getOrCreateInferredProjectForProjectRootPathIfEnabled (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:189938:19)
at _ProjectService.assignOrphanScriptInfoToInferredProject (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:189093:26)
at _ProjectService.assignProjectToOpenedScriptInfo (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:190754:12)
at c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:191283:27
at Array.forEach (<anonymous>)
at _ProjectService.applyChangesInOpenFiles (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:191280:56)
at updateOpen (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:192512:29)
at c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:195231:15
at IpcIOSession.executeWithRequestId (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:195220:14)
at IpcIOSession.executeCommand (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:195229:29)
at IpcIOSession.onMessage (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\typescript.js:195277:68)
at process.<anonymous> (c:\Users\jnorris\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\extensions\node_modules\typescript\lib\_tsserver.js:525:14)
at process.emit (node:events:518:28)
at emit (node:internal/child_process:950:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
@mjbvz ok I recreated the issue a few times and that's the only "error" or "exception" that I can find, hope that helps!
I rewrote that code for 1.98.0 insider / Copilot Chat insider.
@jnorris-cencal would you be able to share the repository you are seeing this with steps how to reproduce. I would like to ensure that this is really fixed.
@dbaeumer Oh awesome! No sorry this repo is a private work repository otherwise I would share away. Let me know if there's anything else I can do to help
Can you see if you can still reproduce this on 1.98.0 insider and the latest Copilot Chat extension (e.g. insider as well). If so I need to see what I can do to track this down further without you sharing the project.
@dbaeumer Yeah no problem, I've updated everything to latest as of right now, and it still happens. All you have to do to recreate is open Github Chat and then try to use intellisense and it crashes. You can tell it's happening right as you open Github chat because you start getting loading spinners when trying to inspect any code.
@dbaeumer what in my project would have an effect on this? I might be able to share some files but I have no idea what might even cause it haha
@jnorris-cencal thanks for getting back. Which version of TypeScript are you using in your project? You can find this out by opening a TS file and clicking on the {} in the status bar.
And can you append the output content of the GitHub Copilot Chat channel.
@dbaeumer Typescript version is 5.7.3 and here's the output:
2025-02-27 07:23:08.077 [info] Using the Electron fetcher.
2025-02-27 07:23:08.077 [info] Initializing Git extension service.
2025-02-27 07:23:08.077 [info] Successfully activated the vscode.git extension.
2025-02-27 07:23:08.077 [info] Enablement state of the vscode.git extension: true.
2025-02-27 07:23:08.077 [info] Successfully registered Git commit message provider.
2025-02-27 07:23:08.077 [info] TypeScript server plugin activated.
2025-02-27 07:23:08.077 [info] Registered TypeScript context provider with Copilot inline completions.
2025-02-27 07:23:12.168 [info] Logged in as jnorris-cencal
2025-02-27 07:23:12.981 [info] Got Copilot token for jnorris-cencal
2025-02-27 07:23:13.606 [info] copilot token chat_enabled: true, sku: copilot_for_business_seat
2025-02-27 07:23:13.618 [info] Registering default platform agent...
2025-02-27 07:23:13.620 [info] Successfully activated the GitHub.vscode-pull-request-github extension.
2025-02-27 07:23:13.621 [info] [githubTitleAndDescriptionProvider] Initializing GitHub PR title and description provider provider.
2025-02-27 07:23:13.621 [info] Successfully registered GitHub PR title and description provider.
2025-02-27 07:23:13.644 [info] Fetched model metadata in 649ms bc66b7d1-7ca3-48a2-95de-542333bbf027
2025-02-27 07:23:13.663 [info] activationBlocker from 'languageModelAccess' took for 7411ms
2025-02-27 07:23:37.961 [info] Using the Electron fetcher.
2025-02-27 07:23:37.961 [info] Initializing Git extension service.
2025-02-27 07:23:37.961 [info] Successfully activated the vscode.git extension.
2025-02-27 07:23:37.961 [info] Enablement state of the vscode.git extension: true.
2025-02-27 07:23:37.961 [info] Successfully registered Git commit message provider.
2025-02-27 07:23:38.293 [info] TypeScript server plugin activated.
2025-02-27 07:23:38.294 [info] Registered TypeScript context provider with Copilot inline completions.
2025-02-27 07:23:40.682 [info] Logged in as jnorris-cencal
2025-02-27 07:23:41.553 [info] Got Copilot token for jnorris-cencal
2025-02-27 07:23:43.470 [info] copilot token chat_enabled: true, sku: copilot_for_business_seat
2025-02-27 07:23:43.476 [info] Registering default platform agent...
2025-02-27 07:23:43.477 [info] Successfully activated the GitHub.vscode-pull-request-github extension.
2025-02-27 07:23:43.477 [info] [githubTitleAndDescriptionProvider] Initializing GitHub PR title and description provider provider.
2025-02-27 07:23:43.477 [info] Successfully registered GitHub PR title and description provider.
2025-02-27 07:23:43.504 [info] Fetched model metadata in 1937ms 0ca2955b-9169-4754-b4e5-9f78f154f515
2025-02-27 07:23:43.509 [info] activationBlocker from 'languageModelAccess' took for 5621ms
Actually this looks good:
2025-02-27 07:23:08.077 [info] TypeScript server plugin activated. 2025-02-27 07:23:08.077 [info] Registered TypeScript context provider with Copilot inline completions.
For that run do you still see the exception in the tsserver log or see some crashes ?
Yes it still crashed, same log as before, it's a large log, but the only "exception" or "error" i can find is the one included above.
@jnorris-cencal this is really strange. Can you reproduce the crash if you disabled the GitHub copilot chat extension.
And if I give you a special version of the GitHub Copilot chat extension with some extended logging would you be willing to install and test it?
OK. I was able to reproduce this, however the exception will not crash the server. It is some double initialization on my end with results in an exception when I run the init code the second time. It is catch properly and put into the log but doesn't cause any harm right now.
@dbaeumer ah ok, so it's probably something else causing the crash?
I implemented a fix for this and it will land in insiders this week. However I did some extended analysis and the exception couldn't make the TS server crash. I basically tried to register the same handler twice, which throws. My code caught the exception, logged and ignored it and continued as normal. So the crash must come from something else.
@jnorris-cencal are you able to reproduce this crash with GitHub copilot chat disabled?
@dbaeumer sorry it's been a crazy couple of days at work. No if I disable copilot chat the issue doesn't happen. The only way I've been able to recreate it is by opening the github chat panel. I can use the inline chat just fine, its specifically opening the side panel.
That is very strange. The plugin is used when using inline chat, but not when using chat / edit from the side panel.
The fix should be available next week in insider. Could you give that another try and see if it still reproduces.
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!
@dbaeumer this is an ongoing problem. (been weeks)
@atakann I fixed the exceptions for the latest VS Code stable and Copilot Chat. Are you still seeing the exceptions in the log?
@dbaeumer
This issue is still ongoing after latest update. this only stops when i disable copilot completely
also, this doesnt seem to be a problem for some other languages I work with, such as c# (dotnet) and python.
heres the error i see from my log, and i repeat this only occurs when copilot is enabled. (I tried removing all extensions and running just copilot, but still was the case)
Error: Could not resolve JS module 'ms-vsintellicode-typescript' starting at ---mylocalfiles---
also I found something similar here too https://github.com/microsoft/vscode/issues/161570