Repository navigation
finally is not a function error hit with _getServerWorkingDir #1653
Description
Activity
Remy Suen (@rcjsuen) is this still an issue for you?
- addedinfo-neededIssue requires more information from posterIssue requires more information from poster
on Aug 4, 2025 is this still an issue for you?
Dirk Bäumer (@dbaeumer) Yes. I still see the error every day in our telemetry across all three major operating systems.
I looked at the code and I have honestly no idea what is causing it. Do you know if you do anything special with working directories?
I looked at the code and I have honestly no idea what is causing it. Do you know if you do anything special with working directories?
No, we don't. The client options code can be found here. The telemetry shows that
vscode.env.appHostis"desktop"but my suspicions right now are:- strange workspace folder (with some non-standard URI?)
- no workspace folder
- says
"desktop"but is actually Codespaces or some other custom cloud environment - JavaScript packaging/webpack causing promise weirdness
The StackOverflow post seems to suggest they were hitting it on the JSON language server so even a "standard installation" is triggering it.
I am getting the following when I open VSCode with a Salesforce Lightening Web Components project.
I don't understand this bit though and how that would trigger this error...
I managed to solve the problem only by clearing all vs code files.
rm -fr ~/Library/Preferences/com.microsoft.VSCode.helper.plist
rm -fr ~/Library/Preferences/com.microsoft.VSCode.plist
rm -fr ~/Library/Caches/com.microsoft.VSCode
rm -fr ~/Library/Caches/com.microsoft.VSCode.ShipIt/
rm -fr ~/Library/Application\ Support/Code/
rm -fr ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/
rm -fr ~/.vscode/
rm -rf ~/.vscode*Reacted by marsCould it be that a different Promise libary is used that doesn't have
finally.I could change the code to use
try { } finally { }instead but I would like to understand why it is failing- addedbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugand removedinfo-neededIssue requires more information from posterIssue requires more information from poster
on Dec 9, 2025 I managed to solve the problem only by clearing all vs code files.
rm -fr ~/Library/Preferences/com.microsoft.VSCode.helper.plist rm -fr ~/Library/Preferences/com.microsoft.VSCode.plist rm -fr ~/Library/Caches/com.microsoft.VSCode rm -fr ~/Library/Caches/com.microsoft.VSCode.ShipIt/ rm -fr ~/Library/Application\ Support/Code/ rm -fr ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/ rm -fr ~/.vscode/ rm -rf ~/.vscode*
FYI I'm having the exact same problem and these steps solved it for me (even though it deleted all my preferences / extensions). It was blocking several things in my environment.
My versions:
Version: 1.107.1
Commit: 994fd12f8d3a5aa16f17d42c041e5809167e845a
Date: 2025-12-17T14:15:14.850Z (2 wks ago)
Electron: 39.2.3
ElectronBuildId: 12895514
Chromium: 142.0.7444.175
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 24.5.0
vscode-languageserver-node/client/src/node/main.ts
Lines 573 to 589 in df56e72
I see this error in the telemetry of our VS Code extension. If I try to search the error on the Internet, I can find a single StackOverflow post talking about the same thing. I have looked at the code and tried writing a small JavaScript program but can't quite figure out in what case this might happen. We are on 9.0.1 of
vscode-languageclient.