opentui: fatal: undefined is not an object (evaluating 'c3[mode2]') #2800

Closed
opened 2026-02-16 17:37:18 -05:00 by yindo · 7 comments
Owner

Originally created by @Rabeez on GitHub (Nov 12, 2025).

Originally assigned to: @kommander on GitHub.

Description

This is triggered when switching to a custom theme with "darkBase": "none". I've verified that the exact same custom theme json file with a normal rgb hex color works.

TypeError: undefined is not an object (evaluating 'c3[mode2]')
    at resolveColor (src/cli/cmd/tui/context/theme.tsx:64:25)
    at <anonymous> (src/cli/cmd/tui/context/theme.tsx:67:18)
    at map (native:1:11)
    at resolveTheme (src/cli/cmd/tui/context/theme.tsx:66:57)
    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 runTop (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:833:7)
    at runQueue (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:904:42)
    at completeUpdates (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:860:84)
    at runUpdates (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:850:5)
    at setStore (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/store/dist/dev.js:221:5)
    at set (src/cli/cmd/tui/context/theme.tsx:123:9)
    at onMove (src/cli/cmd/tui/component/dialog-theme-list.tsx:26:13)
    at moveTo (src/cli/cmd/tui/ui/dialog-select.tsx:64:11)
    at move (src/cli/cmd/tui/ui/dialog-select.tsx:60:5)
    at <anonymous> (src/cli/cmd/tui/ui/dialog-select.tsx:83:62)
    at emit (node:events:95:22)
    at emitWithPriority (../../node_modules/.bun/@opentui+core@0.1.41+81ecd8642a1892ca/node_modules/@opentui/core/index-kj9k00yt.js:2353:38)
    at processInput (../../node_modules/.bun/@opentui+core@0.1.41+81ecd8642a1892ca/node_modules/@opentui/core/index-kj9k00yt.js:2315:14)
    at <anonymous> (../../node_modules/.bun/@opentui+core@0.1.41+81ecd8642a1892ca/node_modules/@opentui/core/index-kj9k00yt.js:13525:13)
    at emit (node:events:95:22)
    at process (../../node_modules/.bun/@opentui+core@0.1.41+81ecd8642a1892ca/node_modules/@opentui/core/index-kj9k00yt.js:4617:12)
    at <anonymous> (../../node_modules/.bun/@opentui+core@0.1.41+81ecd8642a1892ca/node_modules/@opentui/core/index-kj9k00yt.js:13467:23)
    at emit (node:events:95:22)
    at addChunk (internal:streams/readable:264:47)
    at readableAddChunkPushByteMode (internal:streams/readable:242:18)
    at internalRead (native:38:40)
    at processTicksAndRejections (native:7:39)...

OpenCode version

1.0.61

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @Rabeez on GitHub (Nov 12, 2025). Originally assigned to: @kommander on GitHub. ### Description This is triggered when switching to a custom theme with `"darkBase": "none"`. I've verified that the exact same custom theme json file with a normal rgb hex color works. ``` TypeError: undefined is not an object (evaluating 'c3[mode2]') at resolveColor (src/cli/cmd/tui/context/theme.tsx:64:25) at <anonymous> (src/cli/cmd/tui/context/theme.tsx:67:18) at map (native:1:11) at resolveTheme (src/cli/cmd/tui/context/theme.tsx:66:57) 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 runTop (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:833:7) at runQueue (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:904:42) at completeUpdates (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:860:84) at runUpdates (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/dist/dev.js:850:5) at setStore (../../node_modules/.bun/solid-js@1.9.9/node_modules/solid-js/store/dist/dev.js:221:5) at set (src/cli/cmd/tui/context/theme.tsx:123:9) at onMove (src/cli/cmd/tui/component/dialog-theme-list.tsx:26:13) at moveTo (src/cli/cmd/tui/ui/dialog-select.tsx:64:11) at move (src/cli/cmd/tui/ui/dialog-select.tsx:60:5) at <anonymous> (src/cli/cmd/tui/ui/dialog-select.tsx:83:62) at emit (node:events:95:22) at emitWithPriority (../../node_modules/.bun/@opentui+core@0.1.41+81ecd8642a1892ca/node_modules/@opentui/core/index-kj9k00yt.js:2353:38) at processInput (../../node_modules/.bun/@opentui+core@0.1.41+81ecd8642a1892ca/node_modules/@opentui/core/index-kj9k00yt.js:2315:14) at <anonymous> (../../node_modules/.bun/@opentui+core@0.1.41+81ecd8642a1892ca/node_modules/@opentui/core/index-kj9k00yt.js:13525:13) at emit (node:events:95:22) at process (../../node_modules/.bun/@opentui+core@0.1.41+81ecd8642a1892ca/node_modules/@opentui/core/index-kj9k00yt.js:4617:12) at <anonymous> (../../node_modules/.bun/@opentui+core@0.1.41+81ecd8642a1892ca/node_modules/@opentui/core/index-kj9k00yt.js:13467:23) at emit (node:events:95:22) at addChunk (internal:streams/readable:264:47) at readableAddChunkPushByteMode (internal:streams/readable:242:18) at internalRead (native:38:40) at processTicksAndRejections (native:7:39)... ``` ### OpenCode version 1.0.61 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the opentui label 2026-02-16 17:37:18 -05:00
yindo closed this issue 2026-02-16 17:37:18 -05:00
Author
Owner

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

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

  • #4236: The exact same error message (TypeError: undefined is not an object (evaluating 'c3[mode2]')) at the same location (src/cli/cmd/tui/context/theme.tsx:64:25) when using custom themes with ANSI colors

Both issues appear to be triggering the same underlying bug in the theme resolution code when using custom theme configurations.

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

@github-actions[bot] commented on GitHub (Nov 12, 2025): This issue might be a duplicate of existing issues. Please check: - #4236: The exact same error message (`TypeError: undefined is not an object (evaluating 'c3[mode2]')`) at the same location (`src/cli/cmd/tui/context/theme.tsx:64:25`) when using custom themes with ANSI colors Both issues appear to be triggering the same underlying bug in the theme resolution code when using custom theme configurations. Feel free to ignore if none of these address your specific case.
Author
Owner

@kommander commented on GitHub (Nov 12, 2025):

Ansi colors are not supported.

@kommander commented on GitHub (Nov 12, 2025): Ansi colors are not supported.
Author
Owner

@Sawangg commented on GitHub (Nov 12, 2025):

@kommander is there plan to add back support for the "none" keyword? The transparency of my terminal is not being respected by the system theme and I was hoping the "none" keyword with a custom theme would do the trick

@Sawangg commented on GitHub (Nov 12, 2025): @kommander is there plan to add back support for the "none" keyword? The transparency of my terminal is not being respected by the system theme and I was hoping the "none" keyword with a custom theme would do the trick
Author
Owner

@kommander commented on GitHub (Nov 12, 2025):

Opentui supports the "transparent" keyword. Not sure how that is mapped currently, but should work. If not, that we can and should fix.

@kommander commented on GitHub (Nov 12, 2025): Opentui supports the "transparent" keyword. Not sure how that is mapped currently, but should work. If not, that we can and should fix.
Author
Owner

@Sawangg commented on GitHub (Nov 12, 2025):

The transparent keyword throws the same error sadly

TypeError: undefined is not an object (evaluating 'c3[mode2]')

I don't know if another issue should be created to support both none/transparent

@Sawangg commented on GitHub (Nov 12, 2025): The transparent keyword throws the same error sadly ``` TypeError: undefined is not an object (evaluating 'c3[mode2]') ``` I don't know if another issue should be created to support both none/transparent
Author
Owner

@kommander commented on GitHub (Nov 12, 2025):

Okay I think I am misunderstanding something here, I all look into it.

@kommander commented on GitHub (Nov 12, 2025): Okay I think I am misunderstanding something here, I all look into it.
Author
Owner

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

fixed

@rekram1-node commented on GitHub (Nov 16, 2025): [fixed](https://github.com/sst/opencode/commit/e728b94bcaac1f019b3a03f04465b3c00d3fdc3a)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2800