claude-code - 💡(How to fix) Fix [BUG] VS Code extension blank panel — this.webviews.add(...) is not a function in setupPanel (VS Code 1.122+)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

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)

Root Cause

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:

Fix Action

Fix / Workaround

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.

Code Example

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

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

---

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)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] VS Code extension blank panel — this.webviews.add(...) is not a function in setupPanel (VS Code 1.122+)