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
Bug: Web Terminal & Styles fail to load due to strict CSP (WASM/data: URI blocked) #9420
Bug Report: Web Terminal & Styles fail to load due to strict CSP
Description:
The opencode web interface is broken in standard browsers because the Content Security Policy (CSP) header sent by the server is too strict. It blocks:
WebAssembly: The ghostty-vt.wasm module (loaded via data: URI) is blocked by connect-src.
Styles: Inline styles are blocked because 'unsafe-inline' is missing from style-src.
Environment:
Version: opencode-ai v1.1.25
OS: Linux (Ubuntu)
Browser: Safari / Chrome (latest)
Steps to Reproduce:
Run opencode web --hostname 0.0.0.0.
Open the web interface in a browser.
Observe broken UI (missing styles) or open the terminal (blank screen).
Error Log (Browser Console):
[Error] Refused to apply a stylesheet because its hash, its nonce, or 'unsafe-inline' appears in neither the style-src directive nor the default-src directive...
[Error] Refused to connect to data:application/wasm... because it does not appear in the connect-src directive...
Required Fix:
The server should send a more permissive CSP for the web interface, explicitly allowing:
connect-src data: (for WASM)
style-src 'unsafe-inline' (for UI styles)
script-src 'unsafe-eval' (if required for WASM glue code)
Temporary Workaround:
We are using an Nginx reverse proxy to strip the original CSP and inject a permissive one.
Reacted by atomlab, Connor Brewster, Halil Tezcan KARABULUT and Nathanael Bonfim
Activity
github-actions commentedon Jan 19, 2026
This issue might be a duplicate of existing issues. Please check:
opencode web#6557: Web UI does not load when runningopencode web- related web UI loading issuesFeel free to ignore if these don't address your specific case.