[BUG] VS Code extension blank panel — this.webviews.add(...) is not a function in setupPanel (VS Code 1.122+)

Resolved 💬 2 comments Opened May 30, 2026 by ojhurst Closed Jul 3, 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?

Opening Claude Code in a VS Code editor tab (via claude-vscode.editor.open) crashes with TypeError: this.webviews.add(...) is not a function. The sidebar panel (resolveWebviewView) works fine — only the editor-tab panel (setupPanel) is affected.

The root cause is a missing comma operator in setupPanel. The code calls this.webviews.add(K) and immediately invokes the return value as a function:

// setupPanel — BROKEN (no comma after .add(K))
this.webviews.add(K)(function(){ ... })

// resolveWebviewView — CORRECT (comma separates the expressions)
this.webviews.add(B),(function(){ ... })

Set.prototype.add() returns the Set itself, which is not callable. The comma operator in resolveWebviewView correctly discards the .add() return value before evaluating the next expression.

Reproduced on VS Code 1.122.1 with both Claude Code 2.1.152 and 2.1.158 — the bug is present in both versions.

What Should Happen?

claude-vscode.editor.open should open a Claude Code panel in an editor tab without crashing.

Error Messages/Logs

TypeError: this.webviews.add(...) is not a function
    at MJ.setupPanel (extension.js:824:16147)
    at MJ.createPanel (extension.js:824:15774)
    at extension.js:884:6668
    at Cg._executeContributedCommand (extensionHostProcess.js:502:48815)

The error fires every time a panel-tab open is attempted. The sidebar panel is unaffected because it uses resolveWebviewView, which has the correct comma-separated form.

Steps to Reproduce

  1. Open VS Code 1.122.1
  2. Connect via Remote-SSH to a macOS host
  3. Install Claude Code extension (2.1.152 or 2.1.158)
  4. Run claude-vscode.editor.open from the command palette (or click "Open in New Tab")
  5. Panel shows blank; error appears in extension host log

Environment

  • Claude Code version: 2.1.158 (also reproduced on 2.1.152)
  • VS Code version: 1.122.1 (commit 8761a556)
  • OS: macOS 15.5 (darwin-arm64)
  • Connection: Remote-SSH
  • Node: v26.0.0

Additional Information

Workaround: In the minified extension.js, find this.webviews.add(K)( inside setupPanel and change to this.webviews.add(K),( (insert a comma). The resolveWebviewView call site already has this comma and works correctly.

The two call sites can be distinguished by the surrounding variable names: setupPanel uses parameter K while resolveWebviewView uses B (in 2.1.158) or x (in 2.1.152) — but the structural pattern is the same in both versions.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗