opentui: fatal: Anchor does not exist #4288

Open
opened 2026-02-16 17:43:18 -05:00 by yindo · 5 comments
Owner

Originally created by @ethaneng on GitHub (Jan 6, 2026).

Originally assigned to: @kommander on GitHub.

Description

Error: Anchor does not exist
    at insertBefore (../../node_modules/.bun/@opentui+core@0.1.67+81ecd8642a1892ca/node_modules/@opentui/core/index-zj0wwh9d.js:13487:17)
    at _insertNode (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:461:10)
    at replaceNode (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:331:5)
    at reconcileArrays (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:292:15)
    at insertExpression (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:199:13)
    at <anonymous> (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:187:44)
    at runComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:724:3)
    at createRenderEffect (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:240:75)
    at insertExpression (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:187:9)...

The above error occurred to me after sending my first message in a session that was previously paused due to my Claude Pro subscription usage running out.

When clicking restart, and trying to send another message, it begins trying to read a few files then fails with the same error a few seconds later.

Not sure how helpful this ticket will be alone, though I was encouraged to report and hence did :).

Plugins

None

OpenCode version

1.0.220

Steps to reproduce

No response

Screenshot and/or share link

Image

https://opncd.ai/share/431vj4lH

Operating System

macOS 15.6.1 (24G90)

Terminal

WezTerm + TMUX

Originally created by @ethaneng on GitHub (Jan 6, 2026). Originally assigned to: @kommander on GitHub. ### Description ``` Error: Anchor does not exist at insertBefore (../../node_modules/.bun/@opentui+core@0.1.67+81ecd8642a1892ca/node_modules/@opentui/core/index-zj0wwh9d.js:13487:17) at _insertNode (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:461:10) at replaceNode (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:331:5) at reconcileArrays (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:292:15) at insertExpression (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:199:13) at <anonymous> (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:187:44) at runComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:742:22) at updateComputation (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:724:3) at createRenderEffect (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:240:75) at insertExpression (../../node_modules/.bun/@opentui+solid@0.1.67+897ebc1644d3edd0/node_modules/@opentui/solid/index.js:187:9)... ``` The above error occurred to me after sending my first message in a session that was previously paused due to my Claude Pro subscription usage running out. When clicking restart, and trying to send another message, it begins trying to read a few files then fails with the same error a few seconds later. Not sure how helpful this ticket will be alone, though I was encouraged to report and hence did :). ### Plugins None ### OpenCode version 1.0.220 ### Steps to reproduce _No response_ ### Screenshot and/or share link <img width="994" height="857" alt="Image" src="https://github.com/user-attachments/assets/1798732a-c3e8-4e46-a3ed-90b5d2d66361" /> https://opncd.ai/share/431vj4lH ### Operating System macOS 15.6.1 (24G90) ### Terminal WezTerm + TMUX
yindo added the opentuibug labels 2026-02-16 17:43:18 -05:00
Author
Owner

@ethaneng commented on GitHub (Jan 6, 2026):

I tried /compact -ing the session and trying again with no luck. I suspect this might be an issue with nesting opencode within a TMUX split (not shown in the screenshot sorry). Once I tried re-opening the session in my terminal outside of TMUX it seemed to start working again - though not sure if just coincidental.

@ethaneng commented on GitHub (Jan 6, 2026): I tried /compact -ing the session and trying again with no luck. I suspect this might be an issue with nesting opencode within a TMUX split (not shown in the screenshot sorry). Once I tried re-opening the session in my terminal outside of TMUX it seemed to start working again - though not sure if just coincidental.
Author
Owner

@kommander commented on GitHub (Jan 6, 2026):

Looks like a race condition in the reconciler. @Adictya do you have an idea when this could happen? It seems like the ref is already destroyed when trying to use it as anchor or the ref that's being added is stale. I saw some issues with stale refs before. Not sure how to handle that.

@kommander commented on GitHub (Jan 6, 2026): Looks like a race condition in the reconciler. @Adictya do you have an idea when this could happen? It seems like the ref is already destroyed when trying to use it as anchor or the ref that's being added is stale. I saw some issues with stale refs before. Not sure how to handle that.
Author
Owner

@Adictya commented on GitHub (Jan 6, 2026):

Hmm yeah, I remember we solved it by reordering some stuff... Will take this up and take a look

@Adictya commented on GitHub (Jan 6, 2026): Hmm yeah, I remember we solved it by reordering some stuff... Will take this up and take a look
Author
Owner

@Adictya commented on GitHub (Jan 12, 2026):

[Reconciler] Inserting node: item-3 into parent: container with anchor: item-3 false

Have found one potential cause of the reconciler using the element itself as an anchor. And if its removed then that could have led to this error.

Working on the fix and exploring more edge cases around this

@Adictya commented on GitHub (Jan 12, 2026): `[Reconciler] Inserting node: item-3 into parent: container with anchor: item-3 false` Have found one potential cause of the reconciler using the element itself as an anchor. And if its removed then that could have led to this error. Working on the fix and exploring more edge cases around this
Author
Owner

@Adictya commented on GitHub (Jan 19, 2026):

Have made this edge case non fatal in https://github.com/anomalyco/opentui/pull/552 and fixed the self anchor bug

This particular error represents a case where a non-destroyed but also non-sibling node is passed as an anchor. Solid uses getNextSibling() to determine the anchor hence it couldn't have been from the solid reconciler layer, either its in one of the internal openTui components or in some direct api call but can't make a full fix at the moment without a reliable reproduction strategy still the pr mentioned should atleast fix the crash.

@Adictya commented on GitHub (Jan 19, 2026): Have made this edge case non fatal in https://github.com/anomalyco/opentui/pull/552 and fixed the self anchor bug This particular error represents a case where a non-destroyed but also non-sibling node is passed as an anchor. Solid uses getNextSibling() to determine the anchor hence it couldn't have been from the solid reconciler layer, either its in one of the internal openTui components or in some direct api call but can't make a full fix at the moment without a reliable reproduction strategy still the pr mentioned should atleast fix the crash.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4288