You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
finally is not a function error hit with _getServerWorkingDir #1653
TypeError this._getServerWorkingDir(...).then(...).finally is not a function
extension.js:1:395787 d.createMessageTransports
extension.js:1:226888 d.createConnection
extension.js:1:217342 d.start
extension.js:1:130234 _
// make sure the folder exists otherwise creating the process will fail
returnnewPromise(s=>{
fs.lstat(cwd!,(err,stats)=>{
s(!err&&stats.isDirectory() ? cwd : undefined);
});
});
}
returnPromise.resolve(undefined);
}
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.
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.
Activity
dbaeumer commentedon Aug 4, 2025
Remy Suen (@rcjsuen) is this still an issue for you?
rcjsuen commentedon Aug 4, 2025
Dirk Bäumer (@dbaeumer) Yes. I still see the error every day in our telemetry across all three major operating systems.
dbaeumer commentedon Aug 6, 2025
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?
rcjsuen commentedon Aug 6, 2025
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:"desktop"but is actually Codespaces or some other custom cloud environmentThe StackOverflow post seems to suggest they were hitting it on the JSON language server so even a "standard installation" is triggering it.
I don't understand this bit though and how that would trigger this error...
VoloviZzz commentedon Aug 12, 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*
dbaeumer commentedon Dec 9, 2025
Could 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 failingmarscosta commentedon Jan 2, 2026
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
Don't rely on Promise.prototype.finally when starting or stopping the…