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
OpenCode Web crashes when selecting any project #19241
I investigated further using the browser console and found a CSP-related error when selecting a project/session:
Executing inline script violates the following Content Security Policy directive:
"script-src 'self' 'wasm-unsafe-eval'".
Either the 'unsafe-inline' keyword, a hash, or a nonce is required.
This appears at the moment when the UI crashes.
Observations
Happens when selecting a project or switching sessions
Reproducible across multiple projects (including a fresh empty repo)
Server endpoints (/project, /session, /vcs/diff) all return successfully
Issue seems entirely on the frontend (web UI)
Hypothesis
It looks like the web UI is attempting to execute an inline script generated from session data, which is blocked by CSP. This might also explain errors like:
e.diffs.map is not a function
Cannot read properties of undefined (reading 'replaceAll')
Workaround
CLI works fine
Web sometimes works after clearing storage or restarting, but loses proper diff visualization
Suggestion
Possibly related to how session data is rendered into the DOM. Maybe missing nonce or unsafe inline usage.
Let me know if you want additional logs or reproduction steps.
Executing inline script violates the following Content Security Policy directive 'script-src 'self' 'wasm-unsafe-eval''. Either the 'unsafe-inline' keyword, a hash ('sha256-QI23YWMJrD/tljM6/82tpL8EwqdBoptwZfycFHA9IiQ='), or a nonce ('nonce-...') is required to enable inline execution. The action has been blocked.
Connecting to 'https://opencode.ai/changelog.json' violates the following Content Security Policy directive: "connect-src 'self' data:". The action has been blocked.
Fetch API cannot load https://opencode.ai/changelog.json. Refused to connect because it violates the document's Content Security Policy.
Activity
github-actions commentedon Mar 26, 2026
This issue might be a duplicate of existing issues. Please check:
TypeError: Cannot read properties of undefined (reading 'replaceAll')error in the web UI on v1.3.2TypeError: e.diffs.map is not a function— which you also reported as a secondary errorPlease review the above issues and comment there if your problem matches.
liuhezhixi commentedon Mar 26, 2026
Same problem, but I installed it using npm in a Windows environment.
StephaneCavallero commentedon Mar 26, 2026
Duplicate of #19217 ?
(link to workaround)
Edit : better workaround : #19241 (comment)
natewill commentedon Mar 26, 2026
Fixes bug
*://127.0.0.1:4096/vcs/diff**://localhost:4096/vcs/diff*onicad commentedon Mar 26, 2026
Additional finding (likely root cause)
I investigated further using the browser console and found a CSP-related error when selecting a project/session:
This appears at the moment when the UI crashes.
Observations
/project,/session,/vcs/diff) all return successfullyHypothesis
It looks like the web UI is attempting to execute an inline script generated from session data, which is blocked by CSP. This might also explain errors like:
e.diffs.map is not a functionCannot read properties of undefined (reading 'replaceAll')Workaround
Suggestion
Possibly related to how session data is rendered into the DOM. Maybe missing nonce or unsafe inline usage.
Let me know if you want additional logs or reproduction steps.
natewill commentedon Mar 26, 2026
@onicad just run
://127.0.0.1:4096/vcs/diff
://localhost:4096/vcs/diff
milewski commentedon Mar 26, 2026
A few console errors:
Executing inline script violates the following Content Security Policy directive 'script-src 'self' 'wasm-unsafe-eval''. Either the 'unsafe-inline' keyword, a hash ('sha256-QI23YWMJrD/tljM6/82tpL8EwqdBoptwZfycFHA9IiQ='), or a nonce ('nonce-...') is required to enable inline execution. The action has been blocked.
Connecting to 'https://opencode.ai/changelog.json' violates the following Content Security Policy directive: "connect-src 'self' data:". The action has been blocked.
Fetch API cannot load https://opencode.ai/changelog.json. Refused to connect because it violates the document's Content Security Policy.
onicad commentedon Mar 26, 2026
Confirmed: if I block these requests in Chrome DevTools Request Blocking,
the web UI no longer crashes when selecting a project.
So the crash appears to be triggered by
/vcs/diffspecifically.Without blocking
/vcs/diff, selecting a project crashes the UI with errors like:TypeError: Cannot read properties of undefined (reading 'replaceAll')e.diffs.map is not a functionWith
/vcs/diffblocked, project selection works.This seems to narrow the issue down to the diff response or how the frontend processes it.
fix: add defensive checks for undefined values in diff handling