[BUG] ERROR Expected null or instance of Node, got an instance of Node

Resolved 💬 3 comments Opened Mar 13, 2026 by quadespresso Closed Apr 12, 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?

Using: Claude Code v2.1.75

Similar but not exact same issue: #31246

I had started a new Claude session, resuming efforts from last night. I had it kick off a long-running job (which I've been doing repeatedly for some days now, without issue).

Scrolling as far back as I can in the terminal, included as attachment.

claude_crash.txt

To save having to dig through the full output, the error starts out with this:

  ERROR  Expected null or instance of Node, got an instance of Node

 /$bunfs/root/src/entrypoints/cli.js:581:98877

and finishes with this:

    A==="foreground"?L$.rgb(D,f,_)(H):L$.bgRgb(D,f,_)(H)}return H};var z3H=J(()=>{i9();x61=/^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,m61=/^ansi256\(\s?(\d+)\s?\)$/});function
    w7D(H,$,A,L=0,D){let f=ZA($),_=H.length;if(f>=_-2)return["",$.substring(0,_),""];let M;if(A==="center")M=Math.floor((_-f)/2);else if(A==="start")M=L+1;else
    M=_-f-L-1;M=Math.max(1,Math.min(M,_-f-1));let K=H.substring(0,1)+D.repeat(M-1),q=D.repeat(_-M-f-1)+H.substring(_-1);return[K,$,q]}function Y3H(H,$,A){let
    L=Rd(H,$);if(A)L=L$.dim(L);return L}var z7D,p61,B61=(H,$,A,L)=>{if(A.style.borderStyle){let
    D=Math.floor(A.yogaNode.getComputedWidth()),f=Math.floor(A.yogaNode.getComputedHeight()),_=typeof
    A.style.borderStyle==="string"?p61[A.style.borderStyle]??z7D.default[A.style.borderStyle]:A.style.borderStyle,M=A.style.borderTopColor??A.style.borderColor,K=A.style.borderBottomColor?
    ?A.style.borderColor,q=A.style.borderLeftColor??A.style.borderColor,P=A.style.borderRightColor??A.style.borderColor,O=A.style.borderTopDimColor??A.style.borderDimColor,w=A.style.border
    BottomDimColor??A.style.borderDimColor,z=A.style.borderLeftDimColor??A.style.borderDimColor,Y=A.style.borderRightDimColor??A.style.borderDimColor,I=A.style.borderTop!==!1,j=A.style.bor
    derBottom!==!1,X=A.style.borderLeft!==!1,E=A.style.borderRight!==!1,G=Math.max(0,D-(X?1:0)-(E?1:0)),T=I?(X?_.topLeft:"")+_.top.repeat(G)+(E?_.topRight:""):"",Z;if(I&&A.style.borderText
    ?.position==="top"){let[B,p,x]=w7D(T,A.style.borderText.content,A.style.borderText.align,A.style.borderText.offset,_.top);Z=Y3H(B,M,O)+p+Y3H(x,M,O)}else if(I)Z=Y3H(T,M,O);let
    k=f;if(I)k-=1;if(j)k-=1;k=Math.max(0,k);let y=(Rd(_.left,q)+`

 - <anonymous> (/$bunfs/root/src/entrypoints/cli.js:581:98877)
 - <anonymous> (/$bunfs/root/src/entrypoints/cli.js:581:98703)
 - a (/$bunfs/root/src/entrypoints/cli.js:582:263)
 - OA (/$bunfs/root/src/entrypoints/cli.js:582:3678)
 - QA (/$bunfs/root/src/entrypoints/cli.js:582:5219)
 - <anonymous> (/$bunfs/root/src/entrypoints/cli.js:582:6729)
 - insertChild (/$bunfs/root/src/entrypoints/cli.js:582:31049)
 - V4A (/$bunfs/root/src/entrypoints/cli.js:582:36714)
 - XU (/$bunfs/root/src/entrypoints/cli.js:568:64959)
 - XU (/$bunfs/root/src/entrypoints/cli.js:568:65066)

I attempted to get Claude's attention by pointing out that it appeared to have dumped several screens of JavaScript, but it didn't respond. I let it sit for a couple hours (off to a meeting), but no change once I returned.

I pressed Ctrl-C to see whether that would get Claude back on track, but it exited to the shell.

When I restarted Claude, I asked it about the failure, to which Claude said:

● That sounds frustrating. Each conversation with me starts fresh — I have no memory of what happened in that previous session, so I can't explain what caused the JavaScript output.

  If you can paste a sample of what was produced, I'm happy to try to figure out what context might have triggered it. Otherwise, just let me know what you'd like to work on now and we can
  pick up from there.

I then shared the beginning and end snippets, to which Claude said:

● That's a crash in the Claude Code CLI itself — not anything in your code or mine. The stack trace is from Bun (the JavaScript runtime that powers the claude CLI), and the error Expected
  null or instance of Node, got an instance of Node is an Ink rendering bug (Ink is the React-based terminal UI library Claude Code uses).

  It was likely triggered when the background test suite completed and Claude Code tried to render the completion notification to the terminal — possibly a race condition or a version
  mismatch in the CLI's UI layer.

  What you should do: Report this at https://github.com/anthropics/claude-code/issues — include the crash output you pasted here.

  For now: We can continue normally. The test suite completed with exit code 0 per the header line. Do you want to check the results?

For added context: When Claude runs these long jobs, it redirects stdout/stderr to a logfile each time. This provides a way for me to follow along in another terminal, as well as providing Claude a way to grep/tail/etc the log file itself to check the status, rather than trying to keep everything in-memory. Or at least, I assume that this helps it avoid keeping everything in-memory.

What Should Happen?

  1. Don't crash when dealing with whatever circumstances caused this particular issue; give a warning where possible, exit gracefully.
  2. If a crash is unavoidable, have it dump relevant diagnostics to a file for the user to attach to a GH issue.
  3. Use the first Ctrl-C to try and get Claude back on the good path again; use a second Ctrl-C within 1-2 secs of the first one to truly exit.

Error Messages/Logs

Steps to Reproduce

I can't think of any reasonable way to attempt to reproduce the issue, other than perhaps the following guess:

  1. create a long-running script which produces 200-500 lines of output over the course of 2 hours
  2. have Claude run the script, redirecting stdout and stderr to a logfile
  3. have Claude periodically check to see whether the expected "this job is done" string is in the file
  4. if the string is found, have Claude notify the user

Note: I didn't hit this issue yesterday; I did update Claude to v2.1.75 this morning.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.74

Claude Code Version

2.1.75 (Claude Code)

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

Linux used:

$ nix --version
nix (Nix) 2.31.2

Terminal used:

$ ghostty --version
Ghostty 1.2.3

Version
  - version: 1.2.3
  - channel: stable
Build Config
  - Zig version   : 0.14.1
  - build mode    : builtin.OptimizeMode.ReleaseFast
  - app runtime   : apprt.Runtime.gtk
  - font engine   : font.main.Backend.fontconfig_freetype
  - renderer      : renderer.generic.Renderer(renderer.OpenGL)
  - libxev        : io_uring
  - kernel version: 6.12.75
  - desktop env   : gnome
  - GTK version   :
    build         : 4.20.3
    runtime       : 4.20.3
  - libadwaita    : enabled
    build         : 1.8.4
    runtime       : 1.8.4
  - libX11        : enabled
  - libwayland    : enabled

View original on GitHub ↗

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