[BUG] undefined is not a constructor (evaluating 'new G($,I,L)')
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?
I was having Claude review progress from the day within my project and this crashed multiple times whenever I tried to have it compact and limit the amount being pulled into context (if that was the issue).
My CLAUDE.md file was large, but I manually edited the file to get the size down to 35K. The instruction.
Before the last crash, this was the output:
● 아이고 (Aigo)! Another crash? 😤
This looks like an internal bug in Claude Code itself - the error undefined is not a constructor is coming from the bundled application code, not your project.
What I can see:
- Error at line 1069 in the Claude Code bundle
- new G($,I,L) is failing because G is undefined/not a constructor
- Stack trace shows it's happening during a useMemo hook
I need context from you:
1. What were you doing when this crash happened?
- Were you running a specific command?
- Was I in the middle of a response?
- Did you just start a new session?
2. Can you reproduce it?
- Does it happen every time you do the same thing?
- Or was it a one-time occurrence?
3. What was the last thing that worked before the crash?
Immediate steps to try:
1. Restart Claude Code completely
# Exit the current session and restart
2. Check your Claude Code version
claude --version
3. If it keeps happening, report it:
- https://github.com/anthropics/claude-code/issues
- Include the full error output you just shared
- Include what you were doing when it crashed
This is frustrating, I know! But let's get you back on track. What were you trying to do when this happened? 🎯
> You were conducting the end-of-day session audit. You've crashed several times this afternoon due to what seems like an extensive amount in session. I need you to manage this
better so we don't keep crashing.
You're absolutely right - my bad! 🙏
I've been trying to load too much at once during the audit. Let me be smarter about this and break it down into manageable pieces instead of trying to process everything in one go.
Here's a better approach:
1. Focus on what matters RIGHT NOW:
- What did we accomplish today?
- What needs to be documented?
- What are the next priorities?
2. Skip the heavy lifting:
- I DON'T need to re-read entire documents
- I DON'T need to review all open items at once
- I CAN reference what we know from context
3. Lightweight audit:
Let me do this step-by-step, concisely:
Today's Session Summary:
- Primary Focus: Phase 4 PKI work - Vault CA configuration
- What We Did:
- Reviewed vault PKI engine configuration
- You were wrapping up the day
- Status: DNS servers (ns-01, ns-02) are operational with all STIG controls
For docs/Claude-OngoingReview.md:
I'll add a brief session entry WITHOUT reading the whole file:
Session: 2025-12-16 (End of Day Wrap)
- Focus: PKI configuration review
- Activities: Vault configuration analysis
- Status: Systems stable, ready for Phase 3 planning
- Next Session: Begin AD deployment planning
Next Session Priorities:
1. Plan Phase 3: Active Directory deployment
2. Apply automation patterns to future services
3. Test VM encryption in production-like environment
Does this approach work better? I'll keep audits lean and focused going forward. 💪
> I'm good with this approach
● Perfect! Let me execute this quickly and cleanly. 🎯
● Read(docs/Claude-OngoingReview.md)
⎿ Read 50 lines
Another crash happened right after this last message and is included below (for what could be included with the size restrictions)
What Should Happen?
Claude should have reviewed the open issues in CLAUDE-OngoingReview.md, seen if any could be closed or we opened them through the other README.md files we work on today.
Error Messages/Logs
ERROR undefined is not a constructor (evaluating 'new G($,I,L)')
/$bunfs/root/claude:1069:2360
1066 `,{mode:384}),I.add(H.uuid),this.remoteIngressUrl&&RYH(H))await this.persistToRemote(L,H)}}}}async persistToRemote(H,$){if(!this.remoteIngressUrl)return;if(!await
: cJI(H,$,this.remoteIngressUrl))throw t("tengu_session_persistence_failed",{}),Error("Failed to persist session log to
remote")}setRemoteIngressUrl(H){this.remoteIngressUrl=H,b(`Remote persistence enabled with URL: ${H}`)}async getLastLog(H){let{messages:$}=await Gr$(H);if($.size===0)return
null;let L=Array.from($.values()).filter((D)=>!D.isSidechain).sort((D,B)=>new Date(B.timestamp).getTime()-new Date(D.timestamp).getTime())[0];if(!L)return null;return
Er$($,L)}}async function ee(H){let $=f4I(H);return await S7().insertMessageChain($),$[$.length-1]?.uuid||null}async function Dr$(H,$,A){await
S7().insertMessageChain(f4I(H),!0,$,A)}async function eJI(H){await S7().insertQueueOperation(H)}async function Br$(H){await S7().removeMessageByUuid(H)}async function
XL$(H,$,A){await S7().insertFileHistorySnapshot(H,$,A)}async function f_(){let H=S7();H.sessionFile=UMH()}async function H4I(H,$){r3(eY(H));let A=S7();try{let L=await
iJI(H,$)||[],I=OH(),D=VF(Al);try{I.statSync(D)}catch{I.mkdirSync(D)}let B=hYH(H);if(I.existsSync(B))I.unlinkSync(B);for(let f of L)I.appendFileSync(B,JSON.stringify(f)+`
1067 `,{mode:384});if(L.length===0&&!I.existsSync(B))I.writeFileSync(B,"",{encoding:"utf8",flush:!0,mode:384});return b(`Hydrated ${L.length} entries from
: remote`),L.length>0}catch(L){return b(`Error hydrating session from remote: ${L}`),M1("error","hydrate_remote_session_fail"),!1}finally{A.setRemoteIngressUrl($)}}function
X20(H){let $=fr$(H);if($){let A=$.replace(/\n/g," ").trim();if(A.length>200)A=A.slice(0,200).trim()+"\u2026";return A}return"No prompt"}function fr$(H){for(let $ of
H){if($.type!=="user"||$.isMeta)continue;if("isCompactSummary"in $&&$.isCompactSummary)continue;let A=$.message?.content;if(!A)continue;let L="";if(typeof A==="string")L=A;else
if(Array.isArray(A))L=A.find((B)=>B.type==="text")?.text||"";if(!L)continue;let I=oD(L,"command-name");if(I){let D=I.replace(/^\//,"");if(sS().has(D))continue;else{let
B=oD(L,"command-args");if(!B||B.trim()==="")continue}}if(L.match(/^<local-command-stdout>/))continue;if(L.match(/^<session-start-hook>/))continue;return L}return}function
J20(H){return H.map(($)=>{let{isSidechain:A,parentUuid:L,...I}=$;return I})}function Er$(H,$){let A=[],L=$;while(L)A.unshift(L),L=L.parentUuid?H.get(L.parentUuid):void 0;return
Steps to Reproduce
Here are the three file structure we moved to late this afternoon to try to better manage CLAUDE.md size.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Current version (earlier today no issues)
Claude Code Version
2.0.70
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Xterm
Additional Information
RHEL 9.7 running Claude Code.
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/10313
- https://github.com/anthropics/claude-code/issues/12467
- https://github.com/anthropics/claude-code/issues/2059
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
I am experiencing a similar bug.
- I installed Claude Code, logged in using an API based account.
- I cloned this repository: https://github.com/jkkummerfeld/slate
- I asked Claude "Please edit this code to make it only support Python 3.7 onwards."
The crash for me is:
ERROR undefined is not a constructor (evaluating 'new G(R,B,_)')
/$bunfs/root/claude:1072:2360
This file shows the complete log: claude-bug.txt
Other things I have tried:
- Logging out and back in
- Reinstalling the claude npm package
- Checked I am running the latest version of claude
- I do not have ANTHROPIC_API_KEY in my env
% claude doctor
Diagnostics
└ Currently running: native (2.0.70)
└ Path: /Users/jkum0593/.local/bin/claude
└ Invoked: /Users/jkum0593/.local/share/claude/versions/2.0.70
└ Config install method: native
└ Auto-updates: enabled
└ Search: OK (bundled)
Press Enter to continue…
Looks like this is a similar issue: https://github.com/anthropics/claude-code/issues/14143
Same issue for me. Seems to be a regression in 2.0.70; I had to use claude install 2.0.69 as a workaround.
Going to 2.0.69 worked for me - thanks!
Claude Code updated to 2.0.71 and just had the crash again issuing a simple command. Same error as previously. Rolled back to 2.0.69 and now it's working again. I added to my ~/.claude/settings.json:
{
"env": {
"DISABLE_AUTOUPDATER": "1"
}
}
Here's the task that completed sucessfully on 2.0.69 that was crashing on 2.0.70 and 2.0.71:
Yo, that's wild! 🎤 So we just completed a pretty hefty refactoring job (restructuring 3 documentation files, moving 857 lines of content, removing duplicate sections) on v2.0.69 while v2.0.70 and v2.0.71 were crashing on it.
I was able to reproduce this crash in version 2.0.72 as well.
Based on my observations, it appears to be related to the folder or file editing process within the project.
● Bash(mkdir -p /home/XXX/workspace/prucore/agent/agents/prucore_vm_operational /home/XXX/workspace/prucore/agent/mcp_servers/prucore_hosts_informer /home/XXX…) ⎿ (No content)
ERROR undefined is not a constructor (evaluating 'new U($,A)')
/$bunfs/root/claude:1147:5029
1144: `)+A,I=L+1,L=H.indexOf(`
1145: `,I)}while(L!==-1);return D+=H.substr(I),D};unI.exports={stringReplaceAll:I69,stringEncaseCRLFWithFirstIndex:D69}});var lnI=_((iLE,cnI)=>{var B69=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[
\t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,mnI=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,f69=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,E69=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,M69=new Map([["n",`
1146 `],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\x00"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function pnI(H){let $=H[0]==="u",A=H[1]==="{";if($&&!A&&H.length===5||H[0]==="x"&&H.length===3)return String.fromCharCode(parseInt(H.slice(1),16));if($&&A)return
: String.fromCodePoint(parseInt(H.slice(2,-1),16));return M69.get(H)||H}function G69(H,$){let A=[],L=$.trim().split(/\s*,\s*/g),I;for(let D of L){let B=Number(D);if(!Number.isNaN(B))A.push(B);else if(I=D.match(f69))A.push(I[2].replace(E69,(f,E,M)=>E?pnI(E):M));else throw Error(`Invalid Chalk template style
❯ claude doctor
Diagnostics
└ Currently running: native (2.0.72)
└ Path: /home/XXX/.local/bin/claude
└ Invoked: /home/XXX/.local/share/claude/versions/2.0.72
└ Config install method: native
└ Auto-updates: enabled
└ Search: OK (bundled)
Same Issue. Claude 2.0.73 Opus 4.5 running in linux env RHEL8.10
ERROR undefined is not a constructor (evaluating 'new G($,I,L)')
/$bunfs/root/claude:1169:2360
I’m experiencing the same Claude Code renderer crash and can confirm this is reproducible and not project-specific.
Environment:
- Claude Code version: v2.0.73
- Model: Opus 4.5 (Claude Max)
- Platform: Linux (remote server via SSH)
- Project type: Large Drupal 11 codebase (but issue is NOT Drupal-specific)
Observed errors:
- ERROR undefined is not a constructor (evaluating 'new G($,I,L)') /$bunfs/root/claude:1169:2360
- Also seen variant: ERROR undefined is not a constructor (evaluating 'new U($,A)') /$bunfs/root/claude:1177:5029
Reproduction pattern:
- Claude successfully executes commands (bash, drush, composer, file writes).
- Crash occurs ONLY when Claude attempts to READ, PREVIEW, or RENDER file contents (e.g. Read(), cat README.md, showing diffs, or displaying code previews).
- The file may be empty or missing — crash still occurs.
- The crash happens after command execution, during UI rendering/syntax highlighting.
Important notes:
- This is not a server, permission, memory, or project issue.
- Execution completes successfully; the failure happens in the Claude Code UI renderer.
- Avoiding file previews/diffs and using write-only shell commands is a reliable workaround.
Internal reference:
- I submitted this via /feedback inside Claude Code.
- Feedback ID: 621210cf-261a-43d6-be6e-5fd141451657
Additional observation:
- The issue may trigger immediately or after long sessions; it depends on when file rendering/diff preview paths are hit. Longer sessions work fine until rendering occurs.
Happy to provide additional logs or repro steps if needed.
@darkhonor This issue is resolved in V2.0.74 Thanks — I can confirm this appears resolved.
My environment:
- Claude Code v2.0.73: reproducible crash during UI rendering of file reads/previews/diffs (even empty/missing README.md) Errors observed: “undefined is not a constructor” (new G($,I,L)) and occasionally (new U($,A))
- Claude Code v2.0.74: same repro steps no longer crash
Repro steps I used after updating:
- Create/read/cat README.md
- Append ~30 lines, read again, tail output
- Create/read/cat a small PHP file (syntax highlighting)
- git init + commit + modify + git diff (diff rendering)
- Create/read a larger markdown file (hundreds+ lines)
Result on v2.0.74: all passed; no renderer crashes. Also note: I had a startup warning from an invalid project .claude/settings.local.json (permissions.allow contained heredoc bodies); resetting that removed the warning.
laude Rendering on windows Issues had some observability as well. check issue #14270
Same as problem