Home / Blog / Pricing

Pricing

Claude Code "Error loading webview" in VS Code: Causes and Fixes

Claude Code in VS Code shows "Error loading webview: Could not register service worker" or a blank panel? What causes it and the fixes from GitHub issues.

6 min read

Error strings and fixes quoted from Claude Code GitHub issues #24142, #17822, #28116 and #101128 (verified Nov 5, 2026). Official troubleshooting checked Nov 5, 2026 in Claude Code’s VS Code docs and VS Code’s extension marketplace docs. Every source is listed at the bottom. No affiliate links on this page (how we work).

The exact error: Error loading webview: Error: Could not register service worker

From #24142 (opened Feb 8, 2026, closed as inactive May 23, 2026, verified Nov 5, 2026):

Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..

Sometimes you don’t get that line at all. You get a blank or black Claude Code panel, an infinite spinner, or a Claude Code couldn't load notice. Same family of problem: the extension’s panel failed to load inside VS Code.

One-line answer: this is a VS Code / extension UI failure, not a Claude plan or usage problem. Your Pro, Max ($100) or Ultra ($200, formerly Max 20x) subscription is not the cause. The panel is Seinfeld: a show about nothing. The window opens, the content doesn’t.

Causes reported in the issues

Only what the issues and docs actually say. No invented reproduction claims.

Service-worker registration failure (#24142, #28116)

#24142 was filed on Windows with extension v2.0.72 (platform:windows, area:ide). Commenters later reported the same class of failure on Linux (VS Code 1.106.1, extension 2.1.52) and macOS (extension 2.1.71, VS Code 1.110.0). One macOS commenter said it was “not a Claude-only issue” — other sidebar extensions hit the same blank state.

#28116 (opened and closed Feb 24, 2026 on extension 2.1.51, Windows) combined an infinite spinner, a French-UI service-worker error, and:

Activating extension 'Anthropic.claude-code' failed: The argument 'filename' must be a file URL object…

Clearing Service Worker / Cache / CachedData cleared the service-worker error for that reporter, but the webview still failed. Reinstall didn’t help. The terminal claude CLI still worked. A reply on the issue said: “We just published v2.1.52 which should hopefully work better.”

Missing ~/.claude/projects folder (#17822)

#17822 (opened Jan 13, 2026 on extension 2.1.5, Windows; closed inactive Sep 7, 2026) reported the same webview error. The reporter traced two causes: a missing ~/.claude/projects directory (ENOENT on scandir) and a corrupted %APPDATA%\Code\Service Worker cache. Later comments (Aug 7 and Oct 12, 2026) said deleting the Service Worker folder alone fixed it for them.

A bad extension build (#101128)

#101128 (opened Oct 10, 2026, still open as of Nov 5, 2026) is the blank-panel version on macOS with VS Code 1.141.0 and extension 2.1.296. The panel is black/empty. Console shows index.js:16 Uncaught SyntaxError: Unexpected identifier 'object'. Clearing caches and moving session files didn’t help. The reported workaround was installing 2.1.295 specifically, then Reload Window. Comments on the thread: on VS Code 1.141.1 a downgrade of the extension alone had no effect, but downgrading VS Code to 1.141.0 worked with extension 2.1.299; on Windows VS Code 1.142.0, 2.1.300 worked and 2.1.301 was blank.

What the official docs say

Claude Code’s VS Code docs (verified Nov 5, 2026) require VS Code 1.94.0 or later. For a blank panel they say: update the extension to v2.1.309 or later, then run Developer: Reload Window. If you then see a Claude Code couldn't load notice, work through the steps it lists. Still blank: run Claude Code: Show Logs and report it on GitHub. The same page documents a Use Terminal setting (claudeCode.useTerminal) so you can keep working in the terminal while the panel is dead, and notes that forks like Devin Desktop and Kiro can install the extension via Open VSX.

Fixes, in order

Each step is tied to a source. Skip anything that doesn’t match your symptoms.

  1. Reload the window. Docs: if the extension doesn’t appear after install, restart VS Code or run Developer: Reload Window (VS Code docs, verified Nov 5, 2026). Cheap. Do it first.
  2. Update the extension to v2.1.309 or later. Same docs section for a blank panel. If you’re on a known-bad build like 2.1.296 / 2.1.301 from #101128, this is the first real fix.
  3. Or install a specific older version. VS Code’s marketplace docs: right-click the extension → Install Another Version (extension marketplace docs, verified Nov 5, 2026). #101128’s reported CLI form was code --install-extension [email protected] --force, then Reload Window. Match the version the open issue says works for your VS Code build, not a random older one.
  4. Create the missing folder if #17822 applies. On Windows PowerShell the reporter used mkdir "$env:USERPROFILE\.claude\projects". Then close VS Code, delete the Service Worker cache folder (%APPDATA%\Code\Service Worker on Windows; ~/.config/Code/Service Worker on Linux), and restart. Later comments said the Service Worker delete alone was enough.
  5. Clear VS Code caches only the way issue comments document. On #24142, after a VS Code 1.112.0 update, reinstall/restart didn’t help; clearing ~/.config/Code/Cache, CachedData, CachedExtensions, GPUCache and User/workspaceStorage did. Another comment: “Deleting ~/.config/Code/CachedExtensions fixed it for me.” Another: “The only thing that worked was updating vscode.” One reporter was resource-starved with a 1.3 GB C/C++ browse database. Don’t wipe random folders; stick to the paths people named in those threads.
  6. Use the terminal CLI meanwhile. #28116 and the VS Code docs both say the CLI still works when the panel doesn’t. Flip on claudeCode.useTerminal, or just run claude in the integrated terminal, and keep coding.
  7. Still broken? Run Claude Code: Show Logs, note your VS Code version and extension version, and file an issue with that plus the exact error line. Don’t name other reporters; just cite the issue URL you’re following.

What not to do: don’t farm a second Claude account, don’t run some “webview unlock” script, and don’t delete your whole user profile “just in case.” A blank panel is a local UI bug. The Picard facepalm is the correct reaction when someone tells you to reinstall your OS for a service worker.

Does Error loading webview use my Claude usage?

Not published as of Nov 5, 2026. No Anthropic doc or maintainer reply on #24142, #17822 or #101128 says a failed webview load burns session usage. If you’re hitting a real usage cap, you’ll see a usage-limit message, not a blank panel. For those, see Claude Code usage limits and Claude Code usage limit reached.

Here’s what I’d do

Reload Window. Update to 2.1.309+. If you’re on the #101128 blank-panel combo, pin the version that thread says works for your VS Code build. If the log shows a missing projects folder or a poisoned Service Worker cache, fix those two paths. Keep the CLI open so the bug doesn’t eat your afternoon. If none of that clears it, file the issue with versions and the exact string above — that’s how #28116 got a same-day 2.1.52 reply.

FAQ

What does Claude Code Error loading webview mean? The Claude Code panel failed to load inside VS Code, usually from a service-worker or extension-build problem, not from your Claude plan.

Does Error loading webview affect my Claude usage? Not published as of Nov 5, 2026; no cited issue or doc says a failed webview load uses session usage.

Can I use Claude Code without the VS Code extension? Yes — the terminal claude CLI still works when the panel fails, and the VS Code docs expose a Use Terminal setting for that mode.

How do I fix Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker? Reload Window, update or roll back the extension, create ~/.claude/projects if missing, and clear the Service Worker / CachedExtensions paths named in #24142 and #17822.

Why is my Claude Code panel blank after updating? #101128 reports a blank panel on some 2.1.296–2.1.301 builds; the VS Code docs say update to v2.1.309 or later, then Reload Window.

Sources

  1. Claude Code GitHub issue #24142 (service-worker InvalidStateError; cache-clear comments; closed inactive): https://github.com/anthropics/claude-code/issues/24142 (verified 2026-11-05)
  2. Claude Code GitHub issue #17822 (missing ~/.claude/projects + Service Worker cache; closed inactive): https://github.com/anthropics/claude-code/issues/17822 (verified 2026-11-05)
  3. Claude Code GitHub issue #28116 (extension 2.1.51 webview failure; v2.1.52 reply; closed completed): https://github.com/anthropics/claude-code/issues/28116 (verified 2026-11-05)
  4. Claude Code GitHub issue #101128 (extension 2.1.296 blank panel; pin 2.1.295; open): https://github.com/anthropics/claude-code/issues/101128 (verified 2026-11-05)
  5. Claude Code VS Code docs (prerequisites, blank panel → v2.1.309+, Reload Window, Show Logs, Use Terminal, forks via Open VSX): https://code.claude.com/docs/en/vs-code (verified 2026-11-05)
  6. VS Code docs, Install Another Version: https://code.visualstudio.com/docs/configure/extensions/extension-marketplace (verified 2026-11-05)

Related reading