Open tritemio opened 3 years ago
I have a known solution on Ubuntu 22.04
I deleted my "~/.config/Code" folder and was able to restore functionality. Its going to be a pain installing all my extensions again, but I've narrowed down the error ( at least in my system )
You can probably fix the issue by clearing the Code folder, or by clearing your "settings". What I suspect is that VS code has some older config-settings which break when updating the version, or become corrupted by some other process.
Note: I did try using the --no-sandbox option with no effect, and had some effect with --user-data-dir ~/fakeFolder, pointing me to the ~/.config/Code deletion solution.
I am seeing this when trying to view the latest Release Notes:
Error loading webview: Error: Could not register service workers: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
I just hit this issue with the latest release trying to display the Release Notes.
I deleted ~/.config/Code/Service Worker
(+ all directories with Cache
in the name) and now it's working again.
Restarting my machine worked as well.. the old faithful turn it off an on again..! ;-)
I am using Fedora and I had the same problem, and believe or not, the problem was because of Brave, do not ask me why. I tried get copilot working and I got this error.
What I did was that:
~/.config/Code
Done. VSCode working again as well as copilot.
rm -rf .config/Code/Service\ Worker/{CacheStorage,ScriptCache}
followed by pkill code
worked for me without restarting my whole machine.
I found that the problem ca be fixed without rebooting by removing all the cache folders used by vscode:
* close vscode (make sure no process is running) * `rm -rf ~/.config/Code/*Cache*` * open vs code
Worked for me.Thanks
I'm affected by this on linux, not even the markdown preview works. I have a lot of [code] <defunct>
entries in my ps -ef
list. killall code
won't remove them (same with pkill
). Restarting your computer to fix your code editor is such a microsofty thing and should never be asked from linux users :smiley:
Edit: after waiting a bit (multiple minutes) the zombie processes have been cleaned up and I can use webviews again without a restart. I also deleted the Cache files, but it did not have any immediate effect.
I'm not sure why #178834 was closed, because this issue is happening when updating to 1.77, and 1.76.2 worked perfectly. I have been checking and this change should have caused the issue:
My extension is totally broken because the webview cannot show my web app and it's kind of difficult to send you a reproducible test case.
/label important
Possibly related on Stack Overflow: Error loading webview: Error: Could not register service workers: TypeError: Failed to register a ServiceWorker for scope
On windows that's %AppData%\Code\Cache
Also happens in 1.80.0 and 1.80.1 with "Hex Editor" installed and trying to open a binary file.
rm -rf .config/Code/Service\ Worker/{CacheStorage,ScriptCache}
pkill code rm -rf .config/Code/Service\ Worker/{CacheStorage,ScriptCache}
Obrigado, essa solução funcionou para mim, estou usando a versão 23.x do ubuntu
I still have the issue and rebooting or restarting VS Code over and over again works, but is extremely time-consuming and therefore not a viable option.
I'm still having this issue running GitLens commands. I'm on Ubuntu. This error occured after updating to version 1.82
Issue still persist on latest version
The issue appeared to me when trying updating a new vscode version. Solution: Reboot pc, thanks @tritemio
For me it occurs anytime I install an extension, which opens up their setting page right after. Restarting vscode fixes the issue for some time.
rm -rf .config/Code/Service\ Worker/{CacheStorage,ScriptCache}
followed bypkill code
worked for me without restarting my whole machine.
worked like a charm.
I just hit this issue with the latest release trying to display the Release Notes. I deleted
~/.config/Code/Service Worker
(+ all directories withCache
in the name) and now it's working again.
This worked like a charm for me in Ubuntu, remember to refresh VSCode! thanks a lot!
This isn't a linux/snap issue, I've seen it plenty of times on Windows.
Get it on windows, on a fresh install
If you are using Ubuntu, there is probably another (maybe hidden) vscode process, which is causing the problem.
Close the vs code first and in terminal try: killall code
Got that all of a sudden on 1.87.0. OK after reboot but I hope it won’t come back too often. 😆 (Xubuntu 20, .deb package install)
This could be a blink bug, maybe resulting from some sort of race condition ... the error is triggered here https://github.com/chromium/chromium/blob/main/third_party/blink/renderer/modules/service_worker/service_worker_container.cc#L427-L430
The provider_
might not be set at creation
https://github.com/chromium/chromium/blob/main/third_party/blink/renderer/modules/service_worker/service_worker_container.cc#L176-L181
Easy workaround on Linux:
i got this problem when i open second vscode windows. only first vscode window can work well, webview in the other windows broken down.
vscode version: 1.89.0 pc: windows 11
Same issue Here!!
Does this issue occur when all extensions are disabled?: No, sice i need to install the markdown extension to occur
VS Code Version: 1.89.1 https://github.com/microsoft/vscode/commit/dc96b837cf6bb4af9cd736aa3af08cf8279f7685 x64 OS Version: linux fedora 40 linux kernel 6.8.9-300.fc40.x86_64 Steps to Reproduce:
Install markdown preview or other Rxtension that uses webview Run the command to show webview
rm -rf .config/Code/Service\ Worker/{CacheStorage,ScriptCache}
followed bypkill code
worked for me without restarting my whole machine.worked like a charm.
Same, worked perfectly, quote replying for future readers
rm -rf .config/Code/Service\ Worker/{CacheStorage,ScriptCache}
followed bypkill code
worked for me without restarting my whole machine.worked like a charm.
Works for same issue when displaying markdown and png files.
OS: Debian Bookworm 12.6 VScodium : 1.91.1 Release : 24193 Context : ~/.config/VSCodium synchronized using rsync from previous machine (Ubuntu + Snap)
Does this issue occur when all extensions are disabled?: No
Steps to Reproduce:
The gitgraph extension shows this error: