Skip to content

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

Closed

Description

@jeromewoody

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

Activity

  1. github-actions commented on Nov 9, 2025

    @github-actions
    Contributor

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

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

  2. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 9, 2025
  3. kennyfrc commented on Nov 9, 2025

    @kennyfrc
    Contributor

    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?)

  4. rekram1-node commented on Nov 9, 2025

    @rekram1-node
    Contributor

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

  5. self-assigned this
    on Nov 9, 2025
  6. mwaltzer commented on Nov 9, 2025

    @mwaltzer

    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)...
    
  7. rekram1-node commented on Nov 9, 2025

    @rekram1-node
    Contributor

    great 😭

  8. thdxr commented on Nov 9, 2025

    @thdxr
    Member

    @somerocketeer are you starting opencode with -m ?

  9. thdxr commented on Nov 9, 2025

    @thdxr
    Member

    see if it's fixed in 1.0.51 - publishing now

  10. the-vampiire commented on Nov 9, 2025

    @the-vampiire

    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
  11. the-vampiire commented on Nov 9, 2025

    @the-vampiire

    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
  12. oafx commented on Nov 9, 2025

    @oafx

    works with brew too, 1.0.51 fixed it for me too

  13. mwaltzer commented on Nov 9, 2025

    @mwaltzer

    Seems fixed on 1.0.51, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions