opentui: fatal: undefined is not an object (evaluating 'flat().length')
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
- start opencode
- attempt to switch models
- observe : UI crashes and returns error stack
Operating System
Mac OS X 26 Taho
Terminal
Warp Client, Terminal.app
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.
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?)
@jeromewoody @kennyfrc try upgrading to 1.0.50 I think I fixed this
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)...
great 😭
@somerocketeer are you starting opencode with -m ?
see if it's fixed in 1.0.51 - publishing now
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
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
works with brew too, 1.0.51 fixed it for me too
Seems fixed on 1.0.51, thank you!