You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeError: undefined is not an object (evaluating 'mode.type') #4690
I saw a few old issues for this but all the solutions do not work. I'm using the default build mode. I've even deleted my opencode.json config file. It's important to note it's not broken everywhere. Only in some directories. My project directories (where I've used opencode before and consistently are broken) while using it in others is working fine. I'm unsure where the issue is.
I've tried using:
1- copilot
2- opencode zen (grok fast)
I've tried:
1- logging in again
2- rm -rf ~/.cache/opencode/
3- npm update in ~.opencode and ~/.cache/opencode
This issue might be related to existing problems with undefined object access during initialization. While not exact duplicates, the following issues involve similar patterns and may provide useful context:
A configuration initialization issue where expected properties are missing
A mode/build configuration validation problem
A cache state corruption similar to what others have reported
The fact that it's only broken in some directories (as mentioned in #4690) suggests it might be related to local configuration (.opencode/opencode.json or similar files) being incomplete or malformed in those specific directories.
Feel free to ignore if none of these address your specific case.
I don't think I fixed it but just to cross something off the list can someone try 1.0.109?
Also do yall have any custom themes that u were using, maybe transparent backgrounds? going to narrow it down more just wanna cross somethings off the list
Yup. Looks like its working fine. Thank you for the quick response and updates. Really appreciate it. been working with opencode a lot lately and it was a pain to switch.
just out of curiosity, can you tell me what was the issue?
I honestly don't know exactly whaat was causing it, but we used to dynamically install npm deps to send requests to ur provider to reduce bundle size, now we bundle in openai, anthropic, and other providers automatically.
Whatever my logic was before was causing something to fail to resolve
Activity
github-actions commentedon Nov 24, 2025
This issue might be related to existing problems with undefined object access during initialization. While not exact duplicates, the following issues involve similar patterns and may provide useful context:
undefined is not an object (evaluating 'c3[mode2]')in theme contextundefined is not an object (evaluating 'sync.data.config.theme')undefined is not an object (evaluating 'color.buffer')The pattern suggests this could be:
The fact that it's only broken in some directories (as mentioned in #4690) suggests it might be related to local configuration (.opencode/opencode.json or similar files) being incomplete or malformed in those specific directories.
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Nov 24, 2025
hm ill take a look
rekram1-node commentedon Nov 24, 2025
can u do:
opencode debug config
and show me output
coolehs commentedon Nov 24, 2025
Running into the same issue even after deleting all of my commands and subagents and a fresh install
Output:
a-essam23 commentedon Nov 24, 2025
Here's the output for
opencode debug config. Might be a little messy because I have a custom mode and command.relsunkaev commentedon Nov 24, 2025
Downgrading to 1.0.105 fixed it, 1.0.106 has the same issue
rekram1-node commentedon Nov 24, 2025
Hm taking a look
rekram1-node commentedon Nov 24, 2025
I don't see
mode.typein the codebase at all, and 1.0.105 works for everyone? Looking at the commits between dont see anything obvious yetIf anyone could run
git bisecton the repo would be great ill keep looking thoa-essam23 commentedon Nov 24, 2025
so i tried uninstalling completely. same issue. i tested with curl and npm install.
git bisectreturns nothing because there's no repo.the issue occurs in certain directories not all. i have no clue why
a-essam23 commentedon Nov 24, 2025
downgrading to 1.0.105 works. though I'd appreciate a solution so I'm not locked into an old version
rekram1-node commentedon Nov 24, 2025
I meant like git bisecting in our source but that's a lot of effort for someone. Ill keep looking
rekram1-node commentedon Nov 24, 2025
I don't think I fixed it but just to cross something off the list can someone try 1.0.109?
Also do yall have any custom themes that u were using, maybe transparent backgrounds? going to narrow it down more just wanna cross somethings off the list
anthnykr commentedon Nov 24, 2025
@rekram1-node that worked, thanks!
rekram1-node commentedon Nov 24, 2025
oh lol how fun, perfect
a-essam23 commentedon Nov 24, 2025
no custom themes here. give me 5 minutes I'll give it a test
rekram1-node commentedon Nov 24, 2025
Sounds good
a-essam23 commentedon Nov 24, 2025
Yup. Looks like its working fine. Thank you for the quick response and updates. Really appreciate it. been working with opencode a lot lately and it was a pain to switch.
just out of curiosity, can you tell me what was the issue?
rekram1-node commentedon Nov 24, 2025
I honestly don't know exactly whaat was causing it, but we used to dynamically install npm deps to send requests to ur provider to reduce bundle size, now we bundle in openai, anthropic, and other providers automatically.
Whatever my logic was before was causing something to fail to resolve
rekram1-node commentedon Nov 24, 2025
Here was the fix tho: 9e44085