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
Desktop UI crashes on load with Cannot read properties of undefined (reading 'id') in session bundle #16459
I hit the same crash twice today on OpenCode Desktop/Web UI startup. The app shows the black "Something went wrong" screen before the main UI finishes loading.
Version
OpenCode: 1.2.20
Actual Behavior
The app crashes during load with:
TypeError: Cannot read properties of undefined (reading id)
at Object.fn (http://127.0.0.1:4096/assets/session-CiCXhYTR.js:14:79062)
at Mk (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:6835)
at Pl (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:6592)
at op (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:8002)
at D6 (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:8883)
at pL (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:8255)
at qr (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:8187)
at http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:5043
The crash screen text is:
Something went wrong
An error occurred while loading the application.
Expected Behavior
If session data is missing or malformed, the app should handle it gracefully instead of crashing the entire UI during startup.
Frequency
Happened twice today
Notes
This looks related to session bootstrap/rendering because the top frame is in assets/session-*.js.
There is already #11702 about runtime crashes from unsafe assumptions, but this report is a user-facing UI crash on 1.2.20 with a concrete startup stack trace.
I have a screenshot of the error screen and can add it in a follow-up comment if that helps.
TypeError: Cannot read properties of undefined (reading 'state')
at c (http://127.0.0.1:4096/assets/session-CiCXkYTR.js:14:76803)
at get metadata (http://127.0.0.1:4096/assets/session-CiCXkYTR.js:14:77783)
at s (http://127.0.0.1:4096/assets/session-CiCXkYTR.js:14:83444)
at Object.fn (http://127.0.0.1:4096/assets/session-CiCXkYTR.js:14:83669)
at Mk (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:6835)
at Pl (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:6592)
at op (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:8002)
at D6 (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:8883)
at pL (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:8255)
at qr (http://127.0.0.1:4096/assets/index-jLZvC0f3.js:2:8187)
just happened to me on the web UI, but if I quickly change to a different project as soon as it starts everything is fine. Maybe has something to do with what I was working before restarting the PC
screenshot of working just fine on a random project I didnt even open yesterday
what happens when going to my most recent project
TypeError: Cannot read properties of undefined (reading 'length')
at Object.fn (http://127.0.0.1:4096/assets/session-Cg8YeoLd.js:14:50663)
at Mk (http://127.0.0.1:4096/assets/index-Dl3PGFdp.js:2:6835)
at Pl (http://127.0.0.1:4096/assets/index-Dl3PGFdp.js:2:6592)
at Object._6 (http://127.0.0.1:4096/assets/index-Dl3PGFdp.js:2:5606)
at get style (http://127.0.0.1:4096/assets/session-Cg8YeoLd.js:14:51075)
at jL (http://127.0.0.1:4096/assets/index-Dl3PGFdp.js:2:24146)
at Object.fn (http://127.0.0.1:4096/assets/index-Dl3PGFdp.js:2:23793)
at Mk (http://127.0.0.1:4096/assets/index-Dl3PGFdp.js:2:6835)
at Pl (http://127.0.0.1:4096/assets/index-Dl3PGFdp.js:2:6592)
at Oe (http://127.0.0.1:4096/assets/index-Dl3PGFdp.js:2:1831)
I have multiple different servers on different ubuntu VMs that are all doing this today. Switching the hostname that I use to access the application appears to fix it, until I open up the project.
I uninstalled and reinstalled opencode, and it continues happening as soon as I begin a new session in the web ui. I wonder if there isn't some aggressive time-change stuff going on in there.
current() returns undefined when options() is temporarily empty — which happens during startup before the file-manager/app list resolves, or during project switching. Downstream accesses like current().id, current().label, and current().icon (lines 421, 423, 428, 458) then throw the TypeError.
Fix
Add a hardcoded fallback so current() is never undefined:
This is the same defensive pattern used in PR #16476 (props.text?.length ?? 0) and PR #16475 (createMemo(() => props.text ?? "")) which fix the structurally identical Cannot read properties of undefined (reading 'length') crash in TextShimmer (issue #16473).
am i correct in understanding that when you run opencode webmost requests for static assets are forwarded to app.opencode.ai and therefore we have no way to control which version of opencode desktop is running via the web command?
@tobeycodes Yes, that's correct — with one important nuance.
When you run opencode web, the server starts locally but the UI assets (HTML/JS/CSS) are proxied live from https://app.opencode.ai via the catch-all route in server.ts:564-579. So the frontend version you get is whatever is currently deployed to app.opencode.ai, not the version that matches your local opencode binary.
This means:
You can't pin the UI version by staying on an older opencode binary — the frontend always comes from the live CDN
Fixes deployed to app.opencode.ai will reach you immediately without a binary update
The crash in this issue will be resolved once PR #16478 (or a similar fix) is merged and deployed to app.opencode.ai
The Desktop app (Tauri) is different — it bundles the UI assets locally, so the version is pinned to the release you installed.
Activity
cyberprophet commentedon Mar 7, 2026
cyberprophet commentedon Mar 7, 2026
franBec commentedon Mar 7, 2026
just happened to me on the web UI, but if I quickly change to a different project as soon as it starts everything is fine. Maybe has something to do with what I was working before restarting the PC
screenshot of working just fine on a random project I didnt even open yesterday

what happens when going to my most recent project
my setup
jon23d commentedon Mar 7, 2026
I have multiple different servers on different ubuntu VMs that are all doing this today. Switching the hostname that I use to access the application appears to fix it, until I open up the project.
tobeycodes commentedon Mar 7, 2026
This is happening for me but I have not updated opencode (currently on 1.2.15) so it is slightly oddopencode web is auto updating and running 1.2.20bxb1337 commentedon Mar 7, 2026
This is happening for me, on 1.2.19 and 1.2.20. Same error output
yhdev7935 commentedon Mar 7, 2026
guys have you used gpt 5.4 model? i got the same err
jon23d commentedon Mar 7, 2026
I uninstalled and reinstalled opencode, and it continues happening as soon as I begin a new session in the web ui. I wonder if there isn't some aggressive time-change stuff going on in there.
bxb1337 commentedon Mar 7, 2026
I use.
ajinkyaT commentedon Mar 7, 2026
Same issue here, updated to the latest version 1.2.25 still not resolving it.
cyberprophet commentedon Mar 7, 2026
Root Cause Analysis
The crash originates in
packages/app/src/components/session/session-header.tsxat line 306:current()returnsundefinedwhenoptions()is temporarily empty — which happens during startup before the file-manager/app list resolves, or during project switching. Downstream accesses likecurrent().id,current().label, andcurrent().icon(lines 421, 423, 428, 458) then throw theTypeError.Fix
Add a hardcoded fallback so
current()is neverundefined:This is the same defensive pattern used in PR #16476 (
props.text?.length ?? 0) and PR #16475 (createMemo(() => props.text ?? "")) which fix the structurally identicalCannot read properties of undefined (reading 'length')crash inTextShimmer(issue #16473).Related
current()undefined crash, triggered by fast project switching<Show>stale-read analysis;session-header.tsxis listed as one of the unfixed filesTextShimmerA PR fixing this is incoming.
fix(app): guard session-header current() against undefined when optio…
tobeycodes commentedon Mar 7, 2026
am i correct in understanding that when you run
opencode webmost requests for static assets are forwarded to app.opencode.ai and therefore we have no way to control which version of opencode desktop is running via the web command?https://github.com/anomalyco/opencode/blob/dev/packages/opencode/src/server/server.ts#L564-L579
cyberprophet commentedon Mar 7, 2026
@tobeycodes Yes, that's correct — with one important nuance.
When you run
opencode web, the server starts locally but the UI assets (HTML/JS/CSS) are proxied live fromhttps://app.opencode.aivia the catch-all route inserver.ts:564-579. So the frontend version you get is whatever is currently deployed toapp.opencode.ai, not the version that matches your localopencodebinary.This means:
opencodebinary — the frontend always comes from the live CDNapp.opencode.aiwill reach you immediately without a binary updateapp.opencode.aiThe Desktop app (Tauri) is different — it bundles the UI assets locally, so the version is pinned to the release you installed.
tobeycodes commentedon Mar 7, 2026
where is the nuance? all you did was confirm what i said