code-server: [Bug]: vscodevim extension broken

Is there an existing issue for this?

  • 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?

  • I cannot reproduce this in VS Code.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 3
  • Comments: 34 (15 by maintainers)

Most upvoted comments

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

@jsjoeio

  • I’ve tried 3 methods to install vim
  1. leftside ‘Extensions’ tab -> search ‘vim’ on marketplace and click ‘Install’ button -> “Error while installing ‘Vim’ extension.” pop-up

  1. Follow as [avsthiago] did: https://github.com/coder/code-server/issues/4830#issuecomment-1092917603
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

=> it works OK. vim is installed, not in remote - installed, it’s in browser - installed.


  1. wget -c https://open-vsx.org/api/vscodevim/vim/1.22.2/file/vscodevim.vim-1.22.2.vsix and install using: code-server --install-extension vscodevim.vim-1.22.2.vsix => “This extension is disabled because it is not supported in Code - OSS for the Web. [Learn More]”

So, to install vim, solution number 2 is the only way: Developer: Install Web Extension

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.

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.

Sorry it took so long to try this out; got busy with work!

I installed the version you mentioned and I get this: image

Did you get a similar issue?

Hello! Just curious if there have been any updates to this issue? Just giving this thread a little bump for love. 😃

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.

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…)

/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

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.

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

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?