[BUG] Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
Status Closed — not planned
Maintainer reply None cached
Activity 9 comments · opened Feb 8, 2026 · closed May 23, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
vscode extention
Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
What Should Happen?
Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
Error Messages/Logs
Steps to Reproduce
Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
v2.0.72
Platform
Other
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
9 Comments
I hit this issue as well on Linux, vscode 1.106.1, claude code extension v2.1.52 (and I tried installing a couple previous versions with no success).
I hit this issue with:
Today is the first time I experience this issue.
Note: I will try to debug this a bit more because this is not a Claude-only issue, as another extensions that use the same approach (sidebar), have the same issue.
I am hitting this issue as well on Ubuntu 22.04
Claude Code Vscode 2.1.79
I can't go on the extension
Same issue after an update to VSCode 1.112.0. It worked before the update. Uninstalling and reinstalling the extension doesn't help. Restarting extensions doesn't help. Restarting VSCode doesn't help.
Ubuntu 24.04, VSCode 1.112.0, Claude Code for VSCode 2.1.79, used with Chat for Claude Code 1.1.0 (he error occurs with or without Chat for Claude Code installed)
The following steps did fix the issue:
Clear these directories:
~/.config/Code/Cache
~/.config/Code/CachedData
~/.config/Code/CachedExtensions
~/.config/Code/GPUCache
~/.config/Code/User/workspaceStorage
I was also hitting this on Ubuntu 22.04 (I commented earlier in March). In my case, the root cause turned out to be VSCode being resource-starved rather than corrupted cache. Claude Code helped me diagnose it:
.vscode/browse.vc.dbhad grown to 1.3 GB — the C/C++ IntelliSense browse database was indexing every symbol from/usr/include/**and ROS headers becauselimitSymbolsToIncludedHeaderswas set tofalsefiles.watcherExcludewas configured — VSCode was watchingbuild/,install/,log/,.venv/, andnode_modules/(~470 MB of build artifacts)Fix
.vscode/browse.vc.db(it rebuilds automatically)limitSymbolsToIncludedHeaders: trueinc_cpp_properties.jsonfiles.watcherExcludeandsearch.excludefor build artifact directoriesC_Cpp.intelliSenseMemoryLimit: 4096This may not be the same root cause as what others are seeing, but if you're working in a large C++ workspace (especially ROS) and hitting this error intermittently, it's worth checking whether VSCode is just running out of resources to register the service worker.
Roger's cache-clearing fix is also worth trying if the above doesn't help.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
I had the same problem. The only thing that worked was updating vscode.
Just happened to me after a failed prompt; while the prompt seemed to work as usual, it was doing nothing. I restarted VSCode and that happened.
I'm on Linux, Nobara.
Deleting ~/.config/Code/CachedExtensions fixed it for me.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.