opencode icon indicating copy to clipboard operation
opencode copied to clipboard

opentui: fatal: Anchor does not exist

Open ethaneng opened this issue 2 weeks ago • 3 comments

Description

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

ethaneng avatar Jan 06 '26 08:01 ethaneng

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 avatar Jan 06 '26 08:01 ethaneng

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 avatar Jan 06 '26 11:01 kommander

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

Adictya avatar Jan 06 '26 12:01 Adictya

[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 avatar Jan 12 '26 15:01 Adictya