opentui: fatal: undefined is not an object (evaluating 'flat().length') #2708

Closed
opened 2026-02-16 17:36:54 -05:00 by yindo · 11 comments
Owner

Originally created by @jeromewoody on GitHub (Nov 8, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

TypeError: undefined is not an object (evaluating 'flat().length')
    at <anonymous> (src/cli/cmd/tui/ui/dialog-select.tsx:49:49)
    at runComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:724:3)
    at readSignal (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:660:67)
    at <anonymous> (src/cli/cmd/tui/ui/dialog-select.tsx:280:16)
    at runComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:724:3)
    at createRenderEffect (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:240:75)
    at <anonymous> (src/cli/cmd/tui/ui/dialog-select.tsx:273:5)
    at untrack (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:475:12)...

OpenCode version

v1.0.46

Steps to reproduce

  1. start opencode
  2. attempt to switch models
  3. observe : UI crashes and returns error stack

Operating System

Mac OS X 26 Taho

Terminal

Warp Client, Terminal.app

Originally created by @jeromewoody on GitHub (Nov 8, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description ``` TypeError: undefined is not an object (evaluating 'flat().length') at <anonymous> (src/cli/cmd/tui/ui/dialog-select.tsx:49:49) at runComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:742:22) at updateComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:724:3) at readSignal (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:660:67) at <anonymous> (src/cli/cmd/tui/ui/dialog-select.tsx:280:16) at runComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:742:22) at updateComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:724:3) at createRenderEffect (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:240:75) at <anonymous> (src/cli/cmd/tui/ui/dialog-select.tsx:273:5) at untrack (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:475:12)... ``` ### OpenCode version v1.0.46 ### Steps to reproduce 1. start opencode 2. attempt to switch models 3. observe : UI crashes and returns error stack ### Operating System Mac OS X 26 Taho ### Terminal Warp Client, Terminal.app
yindo added the opentuibug labels 2026-02-16 17:36:54 -05:00
yindo closed this issue 2026-02-16 17:36:54 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 8, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3934: Similar SolidJS TUI error with 'undefined is not an object (evaluating 'lines().length')' - same error pattern in TUI components
  • #3868: Related TUI crash with 'undefined is not an object (evaluating 'x3.data.providers')' - similar SolidJS initialization issue
  • #3932: Same 'x3.data.providers' error pattern in TUI context

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 8, 2025): This issue might be a duplicate of existing issues. Please check: - #3934: Similar SolidJS TUI error with 'undefined is not an object (evaluating 'lines().length')' - same error pattern in TUI components - #3868: Related TUI crash with 'undefined is not an object (evaluating 'x3.data.providers')' - similar SolidJS initialization issue - #3932: Same 'x3.data.providers' error pattern in TUI context Feel free to ignore if none of these address your specific case.
Author
Owner

@kennyfrc commented on GitHub (Nov 9, 2025):

I also started getting this today. I was using v1.0.45. I upgraded to v1.0.49, and it still occurs. Yesterday, when using v1.0.45, it did not happen at all. It sounds like an issue in models.dev that happened in the last 12 hours (maybe?)

@kennyfrc commented on GitHub (Nov 9, 2025): I also started getting this today. I was using v1.0.45. I upgraded to v1.0.49, and it still occurs. Yesterday, when using v1.0.45, it did not happen at all. It sounds like an issue in models.dev that happened in the last 12 hours (maybe?)
Author
Owner

@rekram1-node commented on GitHub (Nov 9, 2025):

@jeromewoody @kennyfrc try upgrading to 1.0.50 I think I fixed this

@rekram1-node commented on GitHub (Nov 9, 2025): @jeromewoody @kennyfrc try upgrading to 1.0.50 I think I fixed this
Author
Owner

@mwaltzer commented on GitHub (Nov 9, 2025):

I'm on 1.0.50 and still getting this:

TypeError: undefined is not an object (evaluating 'local.model.parsed().model')
    at <anonymous> (src/cli/cmd/tui/component/prompt/index.tsx:622:47)
    at <anonymous> (../../node_modules/.bun/@opentui+solid@0.0.0-20251108-0c7899b1+1753ef9b65046169/node_modules/@opentui/solid/index.js:140:62)
    at runComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:724:3)
    at createRenderEffect (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:240:75)
    at insert (../../node_modules/.bun/@opentui+solid@0.0.0-20251108-0c7899b1+1753ef9b65046169/node_modules/@opentui/solid/index.js:140:5)
    at <anonymous> (src/cli/cmd/tui/component/prompt/index.tsx:622:5)
    at Prompt (src/cli/cmd/tui/component/prompt/index.tsx:746:12)
    at untrack (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:475:12)
    at runComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:742:22)...
@mwaltzer commented on GitHub (Nov 9, 2025): I'm on 1.0.50 and still getting this: ``` TypeError: undefined is not an object (evaluating 'local.model.parsed().model') at <anonymous> (src/cli/cmd/tui/component/prompt/index.tsx:622:47) at <anonymous> (../../node_modules/.bun/@opentui+solid@0.0.0-20251108-0c7899b1+1753ef9b65046169/node_modules/@opentui/solid/index.js:140:62) at runComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:742:22) at updateComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:724:3) at createRenderEffect (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:240:75) at insert (../../node_modules/.bun/@opentui+solid@0.0.0-20251108-0c7899b1+1753ef9b65046169/node_modules/@opentui/solid/index.js:140:5) at <anonymous> (src/cli/cmd/tui/component/prompt/index.tsx:622:5) at Prompt (src/cli/cmd/tui/component/prompt/index.tsx:746:12) at untrack (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:475:12) at runComputation (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:742:22)... ```
Author
Owner

@rekram1-node commented on GitHub (Nov 9, 2025):

great 😭

@rekram1-node commented on GitHub (Nov 9, 2025): great 😭
Author
Owner

@thdxr commented on GitHub (Nov 9, 2025):

@somerocketeer are you starting opencode with -m ?

@thdxr commented on GitHub (Nov 9, 2025): @somerocketeer are you starting opencode with `-m` ?
Author
Owner

@thdxr commented on GitHub (Nov 9, 2025):

see if it's fixed in 1.0.51 - publishing now

@thdxr commented on GitHub (Nov 9, 2025): see if it's fixed in 1.0.51 - publishing now
Author
Owner

@the-vampiire commented on GitHub (Nov 9, 2025):

i'm getting a similar error on v1.0.49. no flags, just opencode. i was in a session and opened another tab to start a new one and this happens every time now. interestingly the original session kept working fine until i exited it.

unable to copy anything, had to screenshot

Image
@the-vampiire commented on GitHub (Nov 9, 2025): i'm getting a similar error on v1.0.49. no flags, just `opencode`. i was in a session and opened another tab to start a new one and this happens every time now. interestingly the original session kept working fine until i exited it. unable to copy anything, had to screenshot <img width="911" height="1100" alt="Image" src="https://github.com/user-attachments/assets/0ba6f2e2-272d-4966-b00d-77a0bd96c925" />
Author
Owner

@the-vampiire commented on GitHub (Nov 9, 2025):

had to uninstall opencode from homebrew and use the installer script to get the latest version 1.0.51. @thdxr new version fixed it for me

brew uninstall opencode
curl -fsSL https://opencode.ai/install | bash
# source or open new shell session
@the-vampiire commented on GitHub (Nov 9, 2025): had to uninstall opencode from homebrew and use the installer script to get the latest version 1.0.51. @thdxr new version fixed it for me ```sh brew uninstall opencode curl -fsSL https://opencode.ai/install | bash # source or open new shell session ```
Author
Owner

@oafx commented on GitHub (Nov 9, 2025):

works with brew too, 1.0.51 fixed it for me too

@oafx commented on GitHub (Nov 9, 2025): works with brew too, 1.0.51 fixed it for me too
Author
Owner

@mwaltzer commented on GitHub (Nov 9, 2025):

Seems fixed on 1.0.51, thank you!

@mwaltzer commented on GitHub (Nov 9, 2025): Seems fixed on 1.0.51, thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2708