Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting an error when loading webviews in VS Code?

I'm using a portable install of VS Code 1.56.1 on Windows 10. Whenever open an extension from the marketplace, I get the following error:

Error loading webview: Error: Could not register service workers: TypeError: Failed to register a ServiceWorker for scope ('vscode-webview://extensioneditor/') with script ('vscode-webview://extensioneditor/service-worker.js?platform=electron&id=extensionEditor&vscode-resource-origin=https%3A%2F%2FextensionEditor.vscode-webview-test.com'): ServiceWorker cannot be started.

Same thing happens for other things using webviews, with a slightly different path (like VS Code release notes). I'm able to install plugins and view the Feature Contributions tab, but I cannot view the Details and Changelog tabs.

Any thoughts on what could be causing this? This is on a managed machine where security settings might be changing. I'm using a portable install because my installed version stopped working out of the blue last week and this was supposed to be the workaround until that was figured out.

like image 379
Dylan Bramblett Avatar asked May 12 '21 14:05

Dylan Bramblett


2 Answers

I was getting the same error, it looks like an issue introduced on version 1.56.0.

For me the fix was running VS Code without elevated permissions.

I always run as administrator and running without it fixed the issue for me.

like image 78
Diogo Rocha Avatar answered Nov 15 '22 07:11

Diogo Rocha


I had this problem, in terminal use code . --no-sandbox

Updating python3 to the most recent version may also help.

like image 2
Nir Geffen Avatar answered Nov 15 '22 06:11

Nir Geffen