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
web: HTML preview fails when connected to a WSL2 server #63121
In the OpenCode web client in Google Chrome on Windows, connected to an OpenCode server in WSL2 Ubuntu, HTML preview fails on every attempt in my current setup.
Clicking a generated HTML file opens its tab with Preview / Source controls, but the preview is a gray area with a broken-page icon. No explanatory error is visible. I cannot view the generated report without finding and opening it manually.
Expected: Render the HTML preview, or explain why it cannot load and provide an actionable fallback.
Plugins
None found in the inspected global/project configuration or local plugin directories.
OpenCode version
WSL CLI reports opencode v2.2.6, but GET /api/info confirms that the running background server is still 2.0.29 (verified on 2026-11-10). The background service has not yet been restarted after the CLI upgrade, and this preview failure has not been retested against a 2.2.6 server. The exact browser-loaded web build and install/channel are unconfirmed.
Steps to reproduce
Run OpenCode inside WSL2 Ubuntu and connect using its web client in Chrome on Windows.
Have the agent generate an HTML report in the WSL filesystem. The observed file was under /tmp/opencode/, outside the project root.
Click the file link in the conversation and select Preview.
The tab opens, but the preview shows a gray broken-page area instead of the report.
The example filename can be replaced with report.html. Whether an in-workspace file behaves differently has not been tested. The cause has not been isolated to WSL.
Screenshot
The observed UI shows an HTML file tab, Preview / Source controls, and a gray preview with a broken-page icon. The original screenshot is omitted because it contains unrelated project details. Browser console/network errors have not been captured.
Operating System
Client: Windows, Google Chrome (exact versions unavailable).
Server environment: WSL2 Ubuntu, Linux 6.18.33.2-microsoft-standard-WSL2, x86_64.
Terminal
Web client; server-side diagnostics: TERM=xterm-256color, shell /bin/bash.
Thanks for the careful report, and for checking /api/info. That made this easy to pin down.
I think this is a duplicate of #50828. Your running server is 2.0.29. In that version, the web UI's Content-Security-Policy has no frame-src/object-src. HTML and PDF previews are rendered in an iframe from a blob: URL, so the browser blocks them. Chrome then shows exactly the grey area with a broken-page icon that you describe. The fix (#60453, which adds frame-src 'self' blob:; object-src 'self' blob:) came out after 2.0.29 and is included in 2.2.6. So restarting the background service so it runs your installed 2.2.6 should make the preview work. WSL2 and the /tmp/opencode/ location are probably not the cause.
Possible duplicates and related issues, ordered by likelihood:
The bot will close this issue as a duplicate in 1 day unless you reply. If the preview still fails after restarting the server on 2.2.6 (check /api/info), please reply here. Any browser console errors for the preview iframe would help too.
Thanks! The server in your report runs 2.0.29. The CSP problem that blocked HTML previews was fixed in #60453 (tracked in #50828). Please update the WSL server and reopen if it still fails.
We waited a day for a reply and didn't get one, so I'm closing this as a duplicate of #50828.
Your background server was running 2.0.29. In that version, the web UI's Content-Security-Policy has no frame-src/object-src, so the browser blocks the blob: iframe that HTML previews render in. Chrome then shows a grey area with a broken-page icon. #60453 fixed this, and the fix is in 2.2.6. Restarting the background service so it runs your installed 2.2.6 should make the preview work.
If the preview still fails after that (check with /api/info), please reply here with any browser console errors for the preview iframe, and we can reopen this.
Activity
opencodejr commentedon Nov 10, 2026
Thanks for the careful report, and for checking
/api/info. That made this easy to pin down.I think this is a duplicate of #50828. Your running server is 2.0.29. In that version, the web UI's Content-Security-Policy has no
frame-src/object-src. HTML and PDF previews are rendered in an iframe from ablob:URL, so the browser blocks them. Chrome then shows exactly the grey area with a broken-page icon that you describe. The fix (#60453, which addsframe-src 'self' blob:; object-src 'self' blob:) came out after 2.0.29 and is included in 2.2.6. So restarting the background service so it runs your installed 2.2.6 should make the preview work. WSL2 and the/tmp/opencode/location are probably not the cause.Possible duplicates and related issues, ordered by likelihood:
blob:iframes), fixed by fix(cli): allow blob frames and objects in web UI CSP #60453The bot will close this issue as a duplicate in 1 day unless you reply. If the preview still fails after restarting the server on 2.2.6 (check
/api/info), please reply here. Any browser console errors for the preview iframe would help too.neriousy commentedon Nov 10, 2026
Thanks! The server in your report runs 2.0.29. The CSP problem that blocked HTML previews was fixed in #60453 (tracked in #50828). Please update the WSL server and reopen if it still fails.
opencodejr commentedon Nov 11, 2026
We waited a day for a reply and didn't get one, so I'm closing this as a duplicate of #50828.
Your background server was running 2.0.29. In that version, the web UI's Content-Security-Policy has no
frame-src/object-src, so the browser blocks theblob:iframe that HTML previews render in. Chrome then shows a grey area with a broken-page icon. #60453 fixed this, and the fix is in 2.2.6. Restarting the background service so it runs your installed 2.2.6 should make the preview work.If the preview still fails after that (check with
/api/info), please reply here with any browser console errors for the preview iframe, and we can reopen this.