microsoft / vscode

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

ESM: fallback to AMD for vscode.dev anyroute #232785

Open realDuang opened 4 days ago

realDuang commented 4 days ago

Does this issue occur when all extensions are disabled?: No

We recently discovered that using the anyroute activate extension causes the entire vscode.dev to crash, but we haven't made any recent updates.

Upon inspection, it turns out that we had a dependency on the vs/workbench/workbench.web.main type file in webOpener, but it seems to have been removed in some recent vscode releases. This causes all extensions that depend on this file with webOpener to crash.

I wonder is it by design? And is there a way that can be quickly fixed or migrated?

Steps to Reproduce:

  1. build a sample web extension with webOpener ability
  2. import any interface or enum declared from 'vs/workbench/workbench.web.main';
  3. install the extension and reload the vscode web page, it will be crashed with the error below:

Image

Image

Image

realDuang commented 4 days ago

We use vs/workbench/workbench.web.main as the “declare module” and set it as an external dependency at compile time.

    externals: {
      'vs/workbench/workbench.web.main': 'commonjs vs/workbench/workbench.web.main'
    }
bpasero commented 23 hours ago

Can you see if it works fine when you add vscode-esm=false query parameter to the URL to disable our ESM change that we pushed, e.g. https://vscode.dev/?vscode-esm=false

bpasero commented 20 hours ago

This will be fixed as part of a recovery fix this week.

realDuang commented 7 hours ago

Can you see if it works fine when you add vscode-esm=false query parameter to the URL to disable our ESM change that we pushed, e.g. https://vscode.dev/?vscode-esm=false

I've tried at my side. it works! That seems to be the problem here. And it's just a work around. We're still hoping for a full fix soon. Thanks!

bpasero commented 4 hours ago

A fix has been deployed to https://insiders.vscode.dev, could people please try it out?

bpasero commented 4 hours ago

Sorry, we are having trouble to deploy, please hold testing.

bpasero commented 2 hours ago

Now it should be deployed to insiders.vscode.dev 🙏