Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote extension fails to activate in web worker extension host #144513

Open
jeanp413 opened this issue Mar 6, 2022 · 6 comments
Open

Remote extension fails to activate in web worker extension host #144513

jeanp413 opened this issue Mar 6, 2022 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug extension-host Extension host issues remote Remote system operations issues
Milestone

Comments

@jeanp413
Copy link
Contributor

jeanp413 commented Mar 6, 2022

  • 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 #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.
@jeanp413
Copy link
Contributor Author

jeanp413 commented Mar 6, 2022

Created a PR #144515 fixing this.
cc @alexdima

@jrieken jrieken assigned alexdima and unassigned jrieken Mar 7, 2022
@alexdima alexdima added this to the March 2022 milestone Mar 21, 2022
@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Mar 24, 2022
gabritto pushed a commit to gabritto/vscode that referenced this issue Mar 25, 2022
…ces from the web worker extension host origin
@connor4312
Copy link
Member

Are there verification steps for this?

@connor4312 connor4312 added the verification-steps-needed Steps to verify are needed for verification label Mar 25, 2022
@alexdima alexdima added the author-verification-requested Issues potentially verifiable by issue author label Mar 28, 2022
@alexdima
Copy link
Member

@jeanp413 Could you please verify?

@jeanp413
Copy link
Contributor Author

@alexdima not working
image

@rzhao271 rzhao271 reopened this Mar 29, 2022
@rzhao271 rzhao271 modified the milestones: March 2022, April 2022 Mar 29, 2022
@rzhao271 rzhao271 added the verification-found Issue verification failed label Mar 29, 2022
@alexdima alexdima removed verification-found Issue verification failed verification-steps-needed Steps to verify are needed for verification author-verification-requested Issues potentially verifiable by issue author labels Mar 29, 2022
@alexdima
Copy link
Member

alexdima commented 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 #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.

@alexdima alexdima modified the milestones: April 2022, May 2022 Apr 29, 2022
@alexdima alexdima modified the milestones: May 2022, June 2022 Jun 2, 2022
@alexdima alexdima modified the milestones: June 2022, July 2022 Jun 30, 2022
@alexdima alexdima removed this from the July 2022 milestone Jul 29, 2022
@fxpw
Copy link

fxpw commented Mar 27, 2024

hello
I received a similar error
Access to fetch at 'https://api.openai.com/v1/chat/completions' from origin 'vscode-file://vscode-app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: 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.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug extension-host Extension host issues remote Remote system operations issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@jrieken @connor4312 @alexdima @rzhao271 @jeanp413 @fxpw and others