Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS code remote connection: Cannot read properties of undefined (reading 'replace')

VScode Error message

[18:33:55.749] Resolver error: TypeError: Cannot read properties of undefined (reading 'replace')
    at Object.a [as sanitizeConnectionToken] (/Users/username/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:691806)
    at Object.C [as findRunningServer] (/Users/username/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:626542)
    at async /Users/username/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:622510
    at async T (/Users/username/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:619351)
    at async Object.t.resolveWithLocalServer (/Users/username/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:622460)
    at async Object.t.resolve (/Users/username/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:644834)
    at async /Users/username/.vscode/extensions/ms-vscode-remote.remote-ssh-0.84.0/out/extension.js:1:727082
[18:33:55.751] ------

How to reproduce

  • Keep the remote connection in VScode
  • AFK (away from keyboard)
  • When the connection naturally breaks, then retry to connect
  • The error message will occur.

I found that one solution is to remove VScode cache at /Users/username/Library/Application\ Support/Code

But this is definitely not the right way, any one knows the root cause and how to solve it?

like image 554
Lilei Zheng Avatar asked Mar 21 '26 00:03

Lilei Zheng


1 Answers

I was able to fix this problem by upgrading the remote SSH extension version to the pre-release version.

like image 68
Chaohai Wang Avatar answered Mar 24 '26 04:03

Chaohai Wang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!