question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remote extension fails to activate in web worker extension host

See original GitHub issue
  • VS Code Version: stable and insiders

For this release 1.65 work was done to make it possible to run an extension installed in the remote inside the web worker extension host https://github.com/microsoft/vscode/issues/141322

This works when running from sources because the web worker runs of the same origin, but the extension fails to activate both in gitpod and codespaces as the web worker runs on a different origin

It fails when fetching the extension entry point here due to a CORS error in the case of codespaces

webWorkerExtensionHostIframe.html:1 Access to fetch at 'https://jeanp413-gitpod-io-openvscode-server-5rvpx565c4qjx.github.dev/assets/0E16C542C4693E3A109F688CFA203819C5AE/38169/vscode-remote-resource?path=%2Fhome%2Fnode%2F.vscode-remote%2Fextensions%2Fvscodevim.vim-1.22.2%2Fout%2FextensionWeb.js&tkn=0804c611-3408-48a8-a35e-e48ca74f3288' from origin 'https://ef3f0b9f-43aa-4956-a381-e7dbd064af43.vscode-webview.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
alexdimacommented, Apr 29, 2022

I have debugged this and the root cause is that these requests are not caught by the service worker installed on the main thread’s origin. The only reasonable solution would be the one proposed in https://github.com/microsoft/vscode/pull/144515 where we would go to the main thread to make the request, but we would need to do this only for embedders like Codespaces.

0reactions
jeanp413commented, Mar 29, 2022

@alexdima not working image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow running remote extensions in the web worker ... - GitHub
When run in VS Code Desktop or VS Code with remote, I'd like the extension to execute in the local extension host ....
Read more >
Extension Host - Visual Studio Code
Used by the local and remote extension hosts. Extensions need a main entry file to run in it. Browser - Extensions are running...
Read more >
Develop Azure Functions by using Visual Studio Code
Learn how to develop and test Azure Functions by using the Azure Functions extension for Visual Studio Code.
Read more >
Chrome Extensions: Migrating to Manifest V3
Remotely hosted code is no longer allowed; an extension can only execute JavaScript that is included within its package. Promise support has ...
Read more >
Chrome can't load web worker - Stack Overflow
There are numerous workarounds like setting the flag in chrome settings, using a local server instead of directly accessing html or injecting ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found