[BUG] Cannot read properties of undefined (reading 'trim') when resuming session

Resolved 💬 21 comments Opened Jan 7, 2026 by marcondesmacaneiro Closed Apr 8, 2026

Bug Description

When attempting to resume a previous session using the interactive picker or --resume flag, Claude Code crashes with the following error:

ERROR  Cannot read properties of undefined (reading 'trim')

file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2613:4942

- vA7 (file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2613:4942)
- h5 (file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:252:20693)
- IY (file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:252:39057)
- ss (file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:252:49664)
- MJ (file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:252:85801)
- Xf (file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:252:84781)
- u_ (file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:252:84606)
- cS (file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:252:81426)
- j0 (file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:252:6360)
- F1 (file:///Users/marcondesmacaneiro/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:252:4874)

Steps to Reproduce

  1. Have existing sessions in Claude Code history
  2. Run claude and use the interactive picker to select a previous session to resume
  3. Or run claude --resume and select a session
  4. Error occurs immediately when trying to resume

Environment

  • Claude Code Version: 2.1.1 (also occurred on 2.0.76)
  • Node.js Version: v22.17.0
  • OS: macOS (Darwin 25.1.0)
  • Shell: zsh

Investigation Done

  • Session file (.jsonl) is valid JSON - no corrupted lines
  • All summary entries in the session file have valid string content (not null or empty)
  • The issue persists even after upgrading from 2.0.76 to 2.1.1

Expected Behavior

Session should resume normally without crashing.

Additional Context

The session being resumed had 73 messages and the .jsonl file is ~927KB. The file passes JSON validation for all lines.

View original on GitHub ↗

21 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8236
  2. https://github.com/anthropics/claude-code/issues/11113
  3. https://github.com/anthropics/claude-code/issues/12230

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

wojtess · 6 months ago

Got same problem.
I ma using docker container with:
OS: debian:bookworm
Shell: bash
Claude code version: node2.0.76 (Claude Code)
nodejs version: v22.21.0

MikeGitIt · 5 months ago

SAME PROBLEM, using the npm client, not the "native" one. If you all are using Claude Code, to develop Claude Code, then you all are not proving the greatness of Claude Code. Just sayin.

ivan2kh · 5 months ago

Same on 2.1.22.

---

## Environment

  • Claude Code: 2.1.22
  • Node.js: v22.21.0
  • OS: Linux 6.8.0-90-generic x86_64

## Description
When trying to resume a session that was interrupted (Ctrl+C), Claude Code crashes with a trim() error on undefined.

## Steps to reproduce

  1. Start a Claude Code session
  2. Interrupt it with Ctrl+C
  3. Try to resume with claude --continue
  4. Crash occurs

## Reproducibility
Always - happens every time when trying to resume an interrupted session.

## Error
```
ERROR Cannot read properties of undefined (reading 'trim')

file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:2722:6198

  • d15 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:2722:6198)
  • A9 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:601:21820)
  • i2 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:601:38061)
  • oT (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:601:49007)
  • _M (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:601:85342)
  • Li (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:601:84348)
  • qi (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:601:84174)
  • wh (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:601:81067)
  • g0 (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:601:8914)
  • hA (file:///usr/lib/node_modules/@anthropic-ai/claude-code/cli.js:601:7651)

```

## Expected behavior
Session should resume successfully, or provide a clear error message if the session data is corrupted.

## Workaround
Deleting session files in ~/.claude/projects/*/sessions/ allows starting fresh.

greydove749 · 4 months ago

Likely same root cause as #27219 — the TUI renderer calls .trim() on an undefined field when replaying hook event records (hook_success, hook_blocking_error, etc.) during --resume. Root cause analysis and stack trace from the Bun bundle there.

xhrg · 4 months ago

Same here

windows 10
VS Code:1.111.0
Claude Code for VS Code:2.1.74

The claude code cli runs okay

huahanqi · 4 months ago

<img width="472" height="339" alt="Image" src="https://github.com/user-attachments/assets/deffe724-8dcf-4a06-980c-e4d0287a4df0" />

same here,

mac-os
VS Code:1.111.1
Claude Code for VS Code:2.1.74

YukunR · 4 months ago

Hi, @huahanqi @xhrg . I have the same issue in vscode.

Bug detail in Webview Developer Tool's console

TypeError: Cannot read properties of undefined (reading 'trim')
    at lB1 (index.js:1439:27057)
    at index.js:1439:28703
    at Array.every (<anonymous>)
    at get isEmpty (index.js:1439:28667)
    at eT0 (index.js:2042:23005)
    at index.js:2042:14462
    at Array.map (<anonymous>)
    at RZ (index.js:2042:14431)
    at index.js:2042:16467
    at Array.map (<anonymous>)

Error rendering content: TypeError: Cannot read properties of undefined (reading 'trim')
    at lB1 (index.js:1439:27057)
    at index.js:1439:28703
    at Array.every (<anonymous>)
    at get isEmpty (index.js:1439:28667)
    at eT0 (index.js:2042:23005)
    at index.js:2042:14462
    at Array.map (<anonymous>)
    at RZ (index.js:2042:14431)
    at index.js:2042:16467
    at Array.map (<anonymous>) {componentStack: '\n    at ft1 (https://file+.vscode-resource.vscode-…ode-2.1.73-win32-x64/webview/index.js:2040:39447)'}
````

## Workaround (local patch):
**If you have the same bug detail**, you can walkround by:

Find lB1 in your extension's webview/index.js:

~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js


Replace (line 1439 in my file):

function lB1($){return!$.text.trim()||$.text.trim()===cB1}

With:

function lB1($){return!($.text||"").trim()||($.text||"").trim()===cB1}


## Root cause

lB1 calls `$.text.trim()` without checking if `$.text exists`, causing the crash.

Hope this helps
silunuo · 4 months ago

<img width="1040" height="642" alt="Image" src="https://github.com/user-attachments/assets/e46a08bd-fd44-4ac2-a1c4-642f8ac13c05" />

face a similar :
Error rendering content: Cannot read properties of undefined (reading 'trim')

Steps: When total project context (multiple sessions) is too long, sending a new request triggers the error (not when resuming a session).
Env: Claude Code (npm)lastest, Windows11

xhrg · 4 months ago

@YukunR That's fine, thank you very much

Icathian-Rain · 4 months ago
Hi, @huahanqi @xhrg . I have the same issue in vscode. ## Bug detail in Webview Developer Tool's console `` TypeError: Cannot read properties of undefined (reading 'trim') at lB1 (index.js:1439:27057) at index.js:1439:28703 at Array.every (<anonymous>) at get isEmpty (index.js:1439:28667) at eT0 (index.js:2042:23005) at index.js:2042:14462 at Array.map (<anonymous>) at RZ (index.js:2042:14431) at index.js:2042:16467 at Array.map (<anonymous>) Error rendering content: TypeError: Cannot read properties of undefined (reading 'trim') at lB1 (index.js:1439:27057) at index.js:1439:28703 at Array.every (<anonymous>) at get isEmpty (index.js:1439:28667) at eT0 (index.js:2042:23005) at index.js:2042:14462 at Array.map (<anonymous>) at RZ (index.js:2042:14431) at index.js:2042:16467 at Array.map (<anonymous>) {componentStack: '\n at ft1 (https://file+.vscode-resource.vscode-…ode-2.1.73-win32-x64/webview/index.js:2040:39447)'} ` ## Workaround (local patch): **If you have the same bug detail**, you can walkround by: Find lB1 in your extension's webview/index.js: ` ~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js ` Replace (line 1439 in my file): ` function lB1($){return!$.text.trim()||$.text.trim()===cB1} ` With: ` function lB1($){return!($.text||"").trim()||($.text||"").trim()===cB1} ` ## Root cause lB1 calls $.text.trim() without checking if $.text exists`, causing the crash. Hope this helps

On macos, claude code version: anthropic.claude-code-2.1.76-darwin-arm64

the function's name is different, it's called: aB1

Find aB1 in your extension's webview/index.js:

~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js

Replace (line 1439 in my file):

function aB1($){return!$.text.trim()||$.text.trim()===sB1}

With:

function aB1($){return!($.text||"").trim()||($.text||"").trim()===sB1}
greenrock620-png · 3 months ago

<img width="350" height="210" alt="Image" src="https://github.com/user-attachments/assets/dbfeb715-9747-4024-9c98-632078f78390" />持续出现,太烦人了,版本已经是2.1.79了。

lucas-chow · 3 months ago

same here

Claude Code 2.1.79
VScode 1.112.0

<img width="743" height="331" alt="Image" src="https://github.com/user-attachments/assets/2b3bf9d9-c04b-4507-9eb5-c857e9eb5324" />

greenrock620-png · 3 months ago
<img alt="Image" width="350" height="210" src="https://private-user-images.githubusercontent.com/263876058/566076189-dbfeb715-9747-4024-9c98-632078f78390.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM5MTI3ODAsIm5iZiI6MTc3MzkxMjQ4MCwicGF0aCI6Ii8yNjM4NzYwNTgvNTY2MDc2MTg5LWRiZmViNzE1LTk3NDctNDAyNC05Yzk4LTYzMjA3OGY3ODM5MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOVQwOTI4MDBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lNDRjZGY4YTAyZWY1OWM2MzU5OGEwNzlhNjM4MjUxNmE1YWNmMDk5ZDg0OTNlOGIyYWI2OGM3YTg2YWNjODEyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.gWMpbe-LXapV6RHdCTiQso6UHhc5nqd0lG07xLnrZQU">持续出现,太烦人了,版本已经是2.1.79了。

换成哪个版本都出现

og.ts:450 WARN SettingsEditor2: Settings not included in settingsLayout.ts: extensions.requestTimeout, github.copilot.chat.agent.terminal.allowList, github.copilot.chat.agent.terminal.denyList, terminal.integrated.developer.devMode, terminal.integrated.developer.ptyHost.latency, terminal.integrated.developer.ptyHost.startupDelay, terminal.integrated.enableKittyKeyboardProtocol, terminal.integrated.enableWin32InputMode, chat.autopilot.enabled, chat.autoReply, chat.contextUsage.enabled, chat.customizationsMenu.enabled, chat.experimentalSessionsWindowOverride, chat.exploreAgent.defaultModel, chat.growthNotification.enabled, chat.pluginLocations, chat.plugins.enabled, chat.plugins.marketplaces, chat.statusWidget.anonymous, chat.upvoteAnimation, chat.useClaudeHooks, chat.useCustomAgentHooks, accessibility.signals.chatResponseReceived, accessibility.signals.chatUserActionRequired
warn @ log.ts:450
warn @ log.ts:559
warn @ logService.ts:47
onConfigUpdate @ settingsEditor2.ts:1399
setInput @ settingsEditor2.ts:509
log.ts:440 INFO Started local extension host with pid 14052.
console.ts:139 [Extension Host] Created lock file at C:\Users\green\.claude\ide\32030.lock
console.ts:139 [Extension Host] Set CLAUDE_CODE_SSE_PORT=32030 in terminal environment (in-memory)
webviewElement.ts:411 Unrecognized feature: 'local-network-access'.
_createElement @ webviewElement.ts:411
cre @ webviewElement.ts:190
l2e @ webviewElement.ts:62
_createInstance @ instantiationService.ts:162
createInstance @ instantiationService.ts:128
createWebviewElement @ webviewService.ts:13
_show @ overlayWebview.ts:234
claim @ overlayWebview.ts:145
claim @ webviewEditorInput.ts:165
claimWebview @ webviewEditor.ts:173
setInput @ webviewEditor.ts:164
webviewElement.ts:491 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
mountTo @ webviewElement.ts:491
_show @ overlayWebview.ts:259
claim @ overlayWebview.ts:145
claim @ webviewEditorInput.ts:165
claimWebview @ webviewEditor.ts:173
setInput @ webviewEditor.ts:164
index.html?id=28dbc809-d9e9-4b21-89e0-25bb421f7c0e&parentId=1&origin=351b6eec-2f3a-4e39-ab57-7a6ebe8d78b9&swVersion=4&extensionId=Anthropic.claude-code&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app:1060 Unrecognized feature: 'local-network-access'.
(anonymous) @ index.html?id=28dbc809-d9e9-4b21-89e0-25bb421f7c0e&parentId=1&origin=351b6eec-2f3a-4e39-ab57-7a6ebe8d78b9&swVersion=4&extensionId=Anthropic.claude-code&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app:1060
index.html?id=28dbc809-d9e9-4b21-89e0-25bb421f7c0e&parentId=1&origin=351b6eec-2f3a-4e39-ab57-7a6ebe…:1 Loading the font 'data:font/ttf;base64,AAEAAAALAIAAAwAwR1NVQiCLJXoAAAE4AAAAVE9TLzI3T0tHAAABjAAAAGBjbWFwQ5s/ewAACSQAABreZ2x5ZvJtKHkAACekAAD3FGhlYWRYl6BTAAAA4AAAADZoaGVhAlsC+QAAALwAAAAkaG10eBxB//oAAAHsAAAHOGxvY2EFi8dWAAAkBAAAA55tYXhwAu8BgQAAARgAAAAgbmFtZZP3uUsAAR64AAAB+HBvc3RjGEbCAAEgsAAAGSQAAQAAASwAAAAAASz////+AS4AAQAAAAAAAAAAAAAAAAAAAc4AAQAAAAEAAFT7+XFfDzz1AAsBLAAAAAB8JbCAAAAAAHwlsID////9AS4BLQAAAAgAAgAAAAAAAAABAAABzgF1ABcAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKADAAPgACREZMVAAObGF0bgAaAAQAAAAAAAAAAQAAAAQAAAAAAAAAAQAAAAFsaWdhAA...h0C3RyaWFuZ2xlLXVwB3R3aXR0ZXISdHlwZS1oaWVyYXJjaHktc3ViFHR5cGUtaGllcmFyY2h5LXN1cGVyDnR5cGUtaGllcmFyY2h5BnVuZm9sZBN1bmdyb3VwLWJ5LXJlZi10eXBlBnVubG9jawZ1bm11dGUKdW52ZXJpZmllZA52YXJpYWJsZS1ncm91cA92ZXJpZmllZC1maWxsZWQIdmVyaWZpZWQIdmVyc2lvbnMJdm0tYWN0aXZlCnZtLWNvbm5lY3QKdm0tb3V0bGluZQp2bS1ydW5uaW5nAnZtAnZyD3ZzY29kZS1pbnNpZGVycwZ2c2NvZGUEd2FuZAd3YXJuaW5nBXdhdGNoCndoaXRlc3BhY2UKd2hvbGUtd29yZAZ3aW5kb3cJd29yZC13cmFwEXdvcmtzcGFjZS10cnVzdGVkEXdvcmtzcGFjZS11bmtub3duE3dvcmtzcGFjZS11bnRydXN0ZWQHem9vbS1pbgh6b29tLW91dAAA' violates the following Content Security Policy directive: "font-src 'self' https://.vscode-cdn.net". The action has been blocked.
log.ts:440 INFO Settings Sync: Account status changed from uninitialized to unavailable
log.ts:440 INFO MCP Registry configured: https://api.mcp.github.com
log.ts:440 INFO [perf] Render performance baseline is 16ms
log.ts:440 INFO Auto updating outdated extensions. anthropic.claude-code
index.js:8 TypeError: Cannot read properties of undefined (reading 'trim')
at Uj0 (index.js:1439:25598)
at index.js:1439:27010
at Array.every (<anonymous>)
at get isEmpty (index.js:1439:26974)
at LN1 (index.js:2040:19538)
at index.js:2040:13773
at Array.map (<anonymous>)
at index.js:2040:13742
at Array.map (<anonymous>)
at yo0 (index.js:2040:13709)
br @ index.js:8
Q.componentDidCatch.Z.callback @ index.js:8
WU0 @ index.js:6
bU0 @ index.js:8
OV0 @ index.js:8
Z11 @ index.js:8
q11 @ index.js:8
MH @ index.js:8
xU0 @ index.js:8
IV @ index.js:6
(anonymous) @ index.js:8
postMessage
(anonymous) @ index.html?id=28dbc809-d9e9-4b21-89e0-25bb421f7c0e&parentId=1&origin=351b6eec-2f3a-4e39-ab57-7a6ebe8d78b9&swVersion=4&extensionId=Anthropic.claude-code&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app:1282
HostMessaging.channel.port1.onmessage @ index.html?id=28dbc809-d9e9-4b21-89e0-25bb421f7c0e&parentId=1&origin=351b6eec-2f3a-4e39-ab57-7a6ebe8d78b9&swVersion=4&extensionId=Anthropic.claude-code&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app:342
index.js:2039 Error rendering content: TypeError: Cannot read properties of undefined (reading 'trim')
at Uj0 (index.js:1439:25598)
at index.js:1439:27010
at Array.every (<anonymous>)
at get isEmpty (index.js:1439:26974)
at LN1 (index.js:2040:19538)
at index.js:2040:13773
at Array.map (<anonymous>)
at index.js:2040:13742
at Array.map (<anonymous>)
at yo0 (index.js:2040:13709) {componentStack: '\n at yo0 (https://file+.vscode-resource.vscode-…ode-2.1.49-win32-x64/webview/index.js:2039:38142)'}

YukunR · 3 months ago

The minified function names may differ across platforms due to differences in the build environment or AST transformations.

In practice, you can fix this issue by replacing $.text.trim() with ($.text || "").trim() at the corresponding error line (usually line 1439) in:
~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js

Hi, @huahanqi @xhrg . I have the same issue in vscode. ## Bug detail in Webview Developer Tool's console `` TypeError: Cannot read properties of undefined (reading 'trim') at lB1 (index.js:1439:27057) at index.js:1439:28703 at Array.every (<anonymous>) at get isEmpty (index.js:1439:28667) at eT0 (index.js:2042:23005) at index.js:2042:14462 at Array.map (<anonymous>) at RZ (index.js:2042:14431) at index.js:2042:16467 at Array.map (<anonymous>) Error rendering content: TypeError: Cannot read properties of undefined (reading 'trim') at lB1 (index.js:1439:27057) at index.js:1439:28703 at Array.every (<anonymous>) at get isEmpty (index.js:1439:28667) at eT0 (index.js:2042:23005) at index.js:2042:14462 at Array.map (<anonymous>) at RZ (index.js:2042:14431) at index.js:2042:16467 at Array.map (<anonymous>) {componentStack: '\n at ft1 (https://file+.vscode-resource.vscode-…ode-2.1.73-win32-x64/webview/index.js:2040:39447)'} ` ## Workaround (local patch): **If you have the same bug detail**, you can walkround by: Find lB1 in your extension's webview/index.js: ` ~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js ` Replace (line 1439 in my file): ` function lB1($){return!$.text.trim()||$.text.trim()===cB1} ` With: ` function lB1($){return!($.text||"").trim()||($.text||"").trim()===cB1} ` ## Root cause lB1 calls $.text.trim() without checking if $.text exists`, causing the crash. Hope this helps
greenrock620-png · 3 months ago
The minified function names may differ across platforms due to differences in the build environment or AST transformations. In practice, you can fix this issue by replacing $.text.trim() with ($.text || "").trim() at the corresponding error line (usually line 1439) in: ~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js > Hi, @huahanqi @xhrg . I have the same issue in vscode. > ## Bug detail in Webview Developer Tool's console > `` > TypeError: Cannot read properties of undefined (reading 'trim') > at lB1 (index.js:1439:27057) > at index.js:1439:28703 > at Array.every (<anonymous>) > at get isEmpty (index.js:1439:28667) > at eT0 (index.js:2042:23005) > at index.js:2042:14462 > at Array.map (<anonymous>) > at RZ (index.js:2042:14431) > at index.js:2042:16467 > at Array.map (<anonymous>) > > Error rendering content: TypeError: Cannot read properties of undefined (reading 'trim') > at lB1 (index.js:1439:27057) > at index.js:1439:28703 > at Array.every (<anonymous>) > at get isEmpty (index.js:1439:28667) > at eT0 (index.js:2042:23005) > at index.js:2042:14462 > at Array.map (<anonymous>) > at RZ (index.js:2042:14431) > at index.js:2042:16467 > at Array.map (<anonymous>) {componentStack: '\n at ft1 (https://file+.vscode-resource.vscode-…ode-2.1.73-win32-x64/webview/index.js:2040:39447)'} > ` > > > > > > > > > > > > ## Workaround (local patch): > **If you have the same bug detail**, you can walkround by: > Find lB1 in your extension's webview/index.js: > ` > ~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js > ` > > > > > > > > > > > > Replace (line 1439 in my file): > ` > function lB1($){return!$.text.trim()||$.text.trim()===cB1} > ` > > > > > > > > > > > > With: > ` > function lB1($){return!($.text||"").trim()||($.text||"").trim()===cB1} > ` > > > > > > > > > > > > ## Root cause > lB1 calls $.text.trim() without checking if $.text exists`, causing the crash. > Hope this helps
The minified function names may differ across platforms due to differences in the build environment or AST transformations. In practice, you can fix this issue by replacing $.text.trim() with ($.text || "").trim() at the corresponding error line (usually line 1439) in: ~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js > Hi, @huahanqi @xhrg . I have the same issue in vscode. > ## Bug detail in Webview Developer Tool's console > `` > TypeError: Cannot read properties of undefined (reading 'trim') > at lB1 (index.js:1439:27057) > at index.js:1439:28703 > at Array.every (<anonymous>) > at get isEmpty (index.js:1439:28667) > at eT0 (index.js:2042:23005) > at index.js:2042:14462 > at Array.map (<anonymous>) > at RZ (index.js:2042:14431) > at index.js:2042:16467 > at Array.map (<anonymous>) > > Error rendering content: TypeError: Cannot read properties of undefined (reading 'trim') > at lB1 (index.js:1439:27057) > at index.js:1439:28703 > at Array.every (<anonymous>) > at get isEmpty (index.js:1439:28667) > at eT0 (index.js:2042:23005) > at index.js:2042:14462 > at Array.map (<anonymous>) > at RZ (index.js:2042:14431) > at index.js:2042:16467 > at Array.map (<anonymous>) {componentStack: '\n at ft1 (https://file+.vscode-resource.vscode-…ode-2.1.73-win32-x64/webview/index.js:2040:39447)'} > ` > > > > > > > > > > > > ## Workaround (local patch): > **If you have the same bug detail**, you can walkround by: > Find lB1 in your extension's webview/index.js: > ` > ~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js > ` > > > > > > > > > > > > Replace (line 1439 in my file): > ` > function lB1($){return!$.text.trim()||$.text.trim()===cB1} > ` > > > > > > > > > > > > With: > ` > function lB1($){return!($.text||"").trim()||($.text||"").trim()===cB1} > ` > > > > > > > > > > > > ## Root cause > lB1 calls $.text.trim() without checking if $.text exists`, causing the crash. > Hope this helps

thanks,it helps.

AntlerPotato · 3 months ago
The minified function names may differ across platforms due to differences in the build environment or AST transformations. In practice, you can fix this issue by replacing $.text.trim() with ($.text || "").trim() at the corresponding error line (usually line 1439) in: ~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js > Hi, @huahanqi @xhrg . I have the same issue in vscode. > ## Bug detail in Webview Developer Tool's console > `` > TypeError: Cannot read properties of undefined (reading 'trim') > at lB1 (index.js:1439:27057) > at index.js:1439:28703 > at Array.every (<anonymous>) > at get isEmpty (index.js:1439:28667) > at eT0 (index.js:2042:23005) > at index.js:2042:14462 > at Array.map (<anonymous>) > at RZ (index.js:2042:14431) > at index.js:2042:16467 > at Array.map (<anonymous>) > > Error rendering content: TypeError: Cannot read properties of undefined (reading 'trim') > at lB1 (index.js:1439:27057) > at index.js:1439:28703 > at Array.every (<anonymous>) > at get isEmpty (index.js:1439:28667) > at eT0 (index.js:2042:23005) > at index.js:2042:14462 > at Array.map (<anonymous>) > at RZ (index.js:2042:14431) > at index.js:2042:16467 > at Array.map (<anonymous>) {componentStack: '\n at ft1 (https://file+.vscode-resource.vscode-…ode-2.1.73-win32-x64/webview/index.js:2040:39447)'} > ` > > > > > > > > > > > > ## Workaround (local patch): > **If you have the same bug detail**, you can walkround by: > Find lB1 in your extension's webview/index.js: > ` > ~/.vscode/extensions/anthropic.claude-code-<version>-<platform>/webview/index.js > ` > > > > > > > > > > > > Replace (line 1439 in my file): > ` > function lB1($){return!$.text.trim()||$.text.trim()===cB1} > ` > > > > > > > > > > > > With: > ` > function lB1($){return!($.text||"").trim()||($.text||"").trim()===cB1} > ` > > > > > > > > > > > > ## Root cause > lB1 calls $.text.trim() without checking if $.text exists`, causing the crash. > Hope this helps

Yes, there are platform differences — I noticed this when applying the fix. On Windows (anthropic.claude-code-2.1.79-win32-x64), it's eB1 / tB1 in my index.js, not lB1 / cB1 or aB1 / sB1 as mentioned above. Everything else is the same.

devcui · 3 months ago

<img width="507" height="238" alt="Image" src="https://github.com/user-attachments/assets/09a28ed6-2400-4253-8ebe-0ce75781b935" />

beginor · 3 months ago

same issue exists with claude 2.1.92 aand 2.1.81, both linux and macos !

yuanao111111 · 3 months ago

IGNORE THIS COMMENT - testing tool availability

github-actions[bot] · 3 months ago

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.