code-server
code-server copied to clipboard
[Bug]: vscodevim extension broken
Is there an existing issue for this?
- [X] I have searched the existing issues
OS/Web Information
- Web Browser: Firefox, Chrome (PWA)
- Local OS: Arch Linux
- Remote OS: NixOS Linux
- Remote Architecture: amd64
-
code-server --version
: 4.0.1
Steps to Reproduce
Install code-server 4.0.1, install vscodevim.vim either through GUI or CLI, reload, extension does not work
Expected
vscodevim.vim extension works
Actual
With code-server 4.0.1, vscodevim gave an error that it was disabled because it was incompatible. However upon reinstalling, no such error comes up, but it does fail to load. This happens when installing through the GUI, and with code-server --install-extension.
Going back to 3.12.0 (my easiest option under NixOS), vscodevim works without issue again.
Logs
No response
Screenshot/Video
No response
Does this issue happen in VS Code?
- [X] I cannot reproduce this in VS Code.
Are you accessing code-server over HTTPS?
- [X] I am using HTTPS.
Notes
No response
This doesn't seem to be an issue in 4.0.2. Please give that a try!

I'm on 4.0.2 now, the same issue persists. It installs, but doesn't actually work. The status bar does show "Activating Extensions..." after every key combo, but nothing vim-related happens
there are no errors in the browser devtools. Issue is also reproducible with the extension directory copied over from my local VSCode
@f0x52 hmm...I'm not sure what I can do to help since I can't reproduce it myself. What version of the extension are you usng?
To make sure it's reproducible I got a clean code-server install, 4.0.2. Installed on NixOS inside a container
Installing the vscodevim.vim through the web manager uses v1.21.10. Installing the extension seems to work without issue, but it doesn't actually do anything. It should change the cursor to a block shape, which doesn't happen, and typing is completely blocked but without any way to switch modes like normal vim/with a working extension. Any key input does trigger an "Activating extension..." in the activity bar, but nothing else happens, maybe there are some logs I could access, that I wasn't able to find?
@f0x52 Hmm...I have two suspicious. Either another extension is conflicting or there is a setting that is conflicting.
Can you share your settings.json
here? And can you try with only this extension?
My test was with a completely untouched code-server install, no other extensions, no custom settings, and no changes in settings.json does the vim extension actually work when you try it? Maybe the newer vs code version broke something
Ah, okay, you're 3 steps ahead of me.
Yes! I'm using code-server 4.0.2 on macOS right now and it works as expected 🤷♂️
Video
https://user-images.githubusercontent.com/3806031/152889968-29f55486-805b-4dd7-b6e2-9120b88f8290.mov
I'm guessing you've tried installing the extension and then restarting code-server?
@code-asher any ideas on how else we can debug this?
really weird, I'll try reproducing the issues on a local install tomorrow
Sounds good! Keep me posted. We'll get this sorted together, can't code without Vim in VS Code/code-server
ahh im not sure if (and if i did, how..) I missed this, but the console lists
INFO Request to 'https://open-vsx.org/vscode/asset/vscodevim/vim/1.22.1/Microsoft.VisualStudio.Code.WebResources/extension' failed with status code 404
So it's now seemingly failing to fetch the extension at all. Might be related to 1.22.1 just releasing though, 8 hours ago
I also started to have this issue today and reverting to vscodevim.vim v1.21.10 seems to fix it for me. I guess it is probably related to the new 1.22.0/1 release.
@benlimpa same! I think it's the new release. If you take a look at the browser console, it's missing a module called child_process
. My guess is isn't either not including that in the release package or it's trying to access a Node-only module but can't since it's now considered a web extension (in code-server).
Reverting to v1.21.10
works for me.
Upstream: here's the module it can't find: https://github.com/VSCodeVim/Vim/blob/master/src/util/child_process.ts
And this relies on Node APIs which aren't available in web extensions.
This is the only maybe related thing I see: https://github.com/VSCodeVim/Vim/pull/7252
reverting to v1.21.10 from the web gui does bring up "This extension is disabled because it is not supported in code-server for the Web. Learn More"
@f0x52 so strange. I just did it and it works for me?

I wonder if it's an environment issue for you
I had to install v1.21.10 from a local copy because it seems the open-vsx api changed/broke for the older versions as well 404 on https://open-vsx.org/vscode/asset/vscodevim/vim/1.21.10/Microsoft.VisualStudio.Code.WebResources/extension
I guess it doesn't matter that it's already in the local extensions folder, it will always try to install it anew on the browser (clean session) and something might be going wrong there?
Other issue I see is a 404 on https://example.com/static/stable/out/vs/workbench/services/extensions/worker/httpsWebWorkerExtensionHostIframe.html?&vscodeWebWorkerExtHostId=bfce0625-4d3b-437b-87f5-eef1507f8d6e
After some patches related to rimraf in the vscode fork, I do have a working local build based on main
, with a working vim extension. Interesting difference is that the working code-server requests https://open-vsx.org/vscode/asset/vscodevim/vim/1.21.10/Microsoft.VisualStudio.Code.WebResources/extension/package.json
whereas the 4.0.2 release gets a 404 on https://open-vsx.org/vscode/asset/vscodevim/vim/1.21.10/Microsoft.VisualStudio.Code.WebResources/extension
(which is missing the /package.json at the end)
Very interesting observation @f0x52 🤔
I don't think we changed anything with how extensions are handled in 4.0.2. Anything come to mind @code-asher?
/static/stable/out/vs/workbench/services/extensions/worker/httpsWebWorkerExtensionHostIframe.html
missing seems to indeed be the missing piece.
It's the only asset that gets loaded from static/stable/, which I'll have to dig further into why that's getting set, and only set for that specific URL
the stable comes from this._productService.quality
being set, but is somehow the only route affected by this (and whatever code handles the routing for those assets, doesn't add the quality..)
Very very interesting find. I wonder if we need to be including that 🤔
I see it here: https://github.com/code-asher/vscode/blob/main/build/gulpfile.vscode.web.js#L48-L49
But maybe there's another place we need to add/include it.
@code-asher does any of this ring familiar?
The URL I get for that (on 4.0.2) is /static/out/vs/workbench/services/extensions/worker/httpsWebWorkerExtensionHostIframe.html
so it does seem like there is an extra stable
in there somehow which would explain the 404.
I do recall being in this code before. VS Code uses the web endpoint URL template if the commit and quality is set otherwise it just prepends /quality
and/or /commit
if they exist (this is why I added the quality in our build process so it would use our template instead of prepending /commit
).
https://github.com/coder/vscode/blob/96e241330d9c44b64897c1e5031e00aa894103db/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts#L88-L131
So perhaps commit
is not being set in the product.json
resulting in the URL being prepended with /stable
.
Hello! Just curious if there have been any updates to this issue? Just giving this thread a little bump for love. :)
@majordoobie this should be fixed! I tested on 4.2.0 and didn't have any issues. But I'm also using v1.21.10
of the VSCodeVim extension though.
Video
https://user-images.githubusercontent.com/3806031/160660536-8df0b3c3-51a6-4108-a40e-e90facc97824.mov
Sorry it took so long to try this out; got busy with work!
I installed the version you mentioned and I get this:
Did you get a similar issue?
@majordoobie no, see the video above!
I can confirm what @majordoobie sees.
I'm running code-server 4.2.0 installed from Conda. I downloaded the extension v1.21.10 and installed it from the VSIX using the UI.
When I try to install it from the extensions pane I get the following error in the log (window)
[2022-04-07 16:41:18.411] [window] [error] Error: Cannot find the package.json from the location 'http://remote/web-extension-resource/open-vsx.org/vscode/asset/vscodevim/vim/1.22.2/Microsoft.VisualStudio.Code.WebResources/extension'. Failed to fetch
at x.toWebExtension (http://127.0.0.1:8888/code-server/static/out/vs/workbench/workbench.web.main.js:3053:111476)
at async x.addExtensionFromGallery (http://127.0.0.1:8888/code-server/static/out/vs/workbench/workbench.web.main.js:3053:109348)
at async n.doRun (http://127.0.0.1:8888/code-server/static/out/vs/workbench/workbench.web.main.js:3054:4475)
~~After testing some different versions I've found one that works, v1.21.7
.~~ It was not working properly.
What I find weird is that once I install my extension it goes under the REMOTE - INSTALLED
pane while for you, @jsjoeio, it goes under BROWSER - INSTALLED
. I think it is related to the different behaviours that we see.
I managed to get vim v1.22.2 working on code-server 4.2.0 by following these steps.
Command Palette (F1)
Select the option: Developer: Install Web Extension...
Paste the URL https://open-vsx.org/vscode/asset/vscodevim/vim/1.22.2/Microsoft.VisualStudio.Code.WebResources/extension
Click install
I'm using ubuntu docker and vim extension is not working with code-server_4.2.0_amd64.deb
This extension is disabled because it is not supported in Code - OSS for the Web.
I've tried 5 versions of vim extensions, but nothing worked:
vscodevim.vim-1.21.10.vsix
vscodevim.vim-1.21.9.vsix
vscodevim.vim-1.22.0.vsix
vscodevim.vim-1.22.1.vsix
vscodevim.vim-1.22.2.vsix
How I installed:
#!/bin/sh
for f in *.vsix
do
echo "install $f"
bsdtar -xvf $f - extension
NAME="${f%.*}"
mv extension /root/.local/share/code-server/extensions/$NAME
echo "$NAME installed!"
done
I've also tried:
code-server --install-extension
I've successfully installed C/C++ extension, but failed on Vim extension.