opencode icon indicating copy to clipboard operation
opencode copied to clipboard

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

Open jeromewoody opened this issue 1 year ago • 11 comments

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/[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 readSignal (../../node_modules/.bun/[email protected]/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/[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 <anonymous> (src/cli/cmd/tui/ui/dialog-select.tsx:273:5)
    at untrack (../../node_modules/.bun/[email protected]/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

jeromewoody avatar Nov 09 '25 00:11 jeromewoody

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] avatar Nov 09 '25 00:11 github-actions[bot]

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 avatar Nov 09 '25 05:11 kennyfrc

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

rekram1-node avatar Nov 09 '25 06:11 rekram1-node

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/@[email protected]+1753ef9b65046169/node_modules/@opentui/solid/index.js:140:62)
    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 insert (../../node_modules/.bun/@[email protected]+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/[email protected]/node_modules/solid-js/dist/dev.js:475:12)
    at runComputation (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:742:22)...

mwaltzer avatar Nov 09 '25 06:11 mwaltzer

great 😭

rekram1-node avatar Nov 09 '25 06:11 rekram1-node

@somerocketeer are you starting opencode with -m ?

thdxr avatar Nov 09 '25 06:11 thdxr

see if it's fixed in 1.0.51 - publishing now

thdxr avatar Nov 09 '25 06:11 thdxr

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 avatar Nov 09 '25 07:11 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

the-vampiire avatar Nov 09 '25 07:11 the-vampiire

works with brew too, 1.0.51 fixed it for me too

oafx avatar Nov 09 '25 07:11 oafx

Seems fixed on 1.0.51, thank you!

mwaltzer avatar Nov 09 '25 13:11 mwaltzer