microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.54k stars 28.65k forks source link

Unable to install web extension #157028

Closed alcarney closed 1 year ago

alcarney commented 2 years ago

Does this issue occur when all extensions are disabled?: N/A

Steps to Reproduce:

  1. Open vscode.dev
  2. Search for "Esbonio" in the marketplace
  3. Click "Install"

image

I (thought I'd) recently added web extension support to my VSCode extension Esbonio.

Before publishing the extension I tested it in a browser by following this guide and everything seemed to work as expected.

The VSCode UI also seems to agree with me that this is a valid web extension as there is no warning icon and an Install button is presented - however clicking install fails with the dialog saying it is not a valid web extension (as shown in the screenshot above).

If I had to guess what was wrong it would be the fact the extension is also an extension pack that depends on an extension that is not a valid web extension. But there is nothing in the UI that tells me that is the case and it seems to contradict the web extension documentation which says the user should still be able to install it anyway.

Any help in diagnosing this would be appreciated :smile:

alcarney commented 2 years ago

Note: I've pushed an update removing the extensionPack field from the extension's package.json and it now installs correctly, so this issue does not affect the Esbonio extension anymore.

However, I did some digging and I think I found what was causing the behavior I was seeing above

https://github.com/microsoft/vscode/blob/b3dc3301dd22d9695d5e5bdc69e5e23a6db1be58/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts#L428-L439

It looks like installation is blocked if every extension declared in an extension pack has no web support - which makes sense if the parent extension doesn't provide any features of its own.

Unfortunately, it also prevents extensions like Esbonio which also provide their own features from being installed as this banner is never shown to the user.

sandy081 commented 1 year ago

This seems to work now. Hence closing this.