opencode web mode broken: empty page - multiple versions and multiple os #3402

Closed
opened 2026-02-16 17:39:56 -05:00 by yindo · 14 comments
Owner

Originally created by @sciabarracom on GitHub (Dec 8, 2025).

Originally assigned to: @adamdotdevin on GitHub.

Description

I installed opencode using web ui with opencode web, I get a blank page with this error in console:

:49956/assets/index-BRXIaEVp.js:1 Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

executing curl http://localhost::49956/assets/index-BRXIaEVp.js returns the index.html not the javascript

OpenCode version

1.0.134 1.0.133 1.0.132 1.0.131

Steps to reproduce

I installed opencode on both linux and mac various versions - same problem everywhere - the crazy thing this yesterday worked file.

I am puzzled.

Screenshot and/or share link

Image Image

Operating System

mac os 15.16.1, ubuntu 24.04

Terminal

iterm, gnome-terminal

Originally created by @sciabarracom on GitHub (Dec 8, 2025). Originally assigned to: @adamdotdevin on GitHub. ### Description I installed opencode using web ui with `opencode web`, I get a blank page with this error in console: ``` :49956/assets/index-BRXIaEVp.js:1 Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec. ``` executing curl http://localhost::49956/assets/index-BRXIaEVp.js returns the index.html not the javascript ### OpenCode version 1.0.134 1.0.133 1.0.132 1.0.131 ### Steps to reproduce I installed opencode on both linux and mac various versions - same problem everywhere - the crazy thing this yesterday worked file. I am puzzled. ### Screenshot and/or share link <img width="925" height="680" alt="Image" src="https://github.com/user-attachments/assets/ef1e7f27-3660-423f-b116-8c33f99e28ef" /> <img width="1699" height="487" alt="Image" src="https://github.com/user-attachments/assets/6e140cb7-39aa-411e-9158-b55e344b7145" /> ### Operating System mac os 15.16.1, ubuntu 24.04 ### Terminal iterm, gnome-terminal
yindo added the bugweb labels 2026-02-16 17:39:56 -05:00
yindo closed this issue 2026-02-16 17:39:56 -05:00
Author
Owner

@thetaungg commented on GitHub (Dec 8, 2025):

I'm facing the exact same problem

@thetaungg commented on GitHub (Dec 8, 2025): I'm facing the exact same problem
Author
Owner

@thetaungg commented on GitHub (Dec 8, 2025):

I found the reason.
It's because https://desktop.dev.opencode.ai is down.
Every opencode version is pointing to that server to get the static assets for the website and the server and index-BRXIaEVp.js file doesn't exist there anymore.

I'm not sure why opencode is doing that instead of locally building desktop with each version.

If you update the proxy to desktop.opencode.ai in this file and rebuild the binary, it should work

packages/opencode/src/server/server.ts

 .all("/*", async (c) => {
        return proxy(`https://desktop.opencode.ai${c.req.path}`, {
          ...c.req,
          headers: {
            host: "desktop.opencode.ai",
          },
        })

I haven't tried to build the desktop locally and including it in the binary. But we should be able to do that as well

@thetaungg commented on GitHub (Dec 8, 2025): I found the reason. It's because https://desktop.dev.opencode.ai is down. Every opencode version is pointing to that server to get the static assets for the website and the server and `index-BRXIaEVp.js` file doesn't exist there anymore. I'm not sure why opencode is doing that instead of locally building desktop with each version. If you update the proxy to desktop.opencode.ai in this file and rebuild the binary, it should work packages/opencode/src/server/server.ts ``` .all("/*", async (c) => { return proxy(`https://desktop.opencode.ai${c.req.path}`, { ...c.req, headers: { host: "desktop.opencode.ai", }, }) ``` I haven't tried to build the desktop locally and including it in the binary. But we should be able to do that as well
Author
Owner

@adamdotdevin commented on GitHub (Dec 8, 2025):

this should be fixed now, lmk if you see it again

@adamdotdevin commented on GitHub (Dec 8, 2025): this should be fixed now, lmk if you see it again
Author
Owner

@adamdotdevin commented on GitHub (Dec 16, 2025):

Closing, the issue here was that the server was sometimes cached and not using latest version.

@adamdotdevin commented on GitHub (Dec 16, 2025): Closing, the issue here was that the server was sometimes cached and not using latest version.
Author
Owner

@imjeehoo commented on GitHub (Dec 24, 2025):

I see this on 1.0.194
Loading module from “http://127.0.0.1:4096/assets/index-CFCjwJ3H.js” was blocked because of a disallowed MIME type (“text/html”).

@imjeehoo commented on GitHub (Dec 24, 2025): I see this on 1.0.194 `Loading module from “http://127.0.0.1:4096/assets/index-CFCjwJ3H.js” was blocked because of a disallowed MIME type (“text/html”).`
Author
Owner

@sourman commented on GitHub (Dec 24, 2025):

looks like something else is causing the same symptoms at least. Seeing this now. TUI works fine. opencode web gives me blank. JavaScript files are apparently marked incorrect MIME type by the proxy

@sourman commented on GitHub (Dec 24, 2025): looks like something else is causing the same symptoms at least. Seeing this now. TUI works fine. `opencode web` gives me blank. JavaScript files are apparently marked incorrect MIME type by the proxy
Author
Owner

@sourman commented on GitHub (Dec 24, 2025):

I submitted #6113 to hopefully fix this? not sure what other issues might be linked

@sourman commented on GitHub (Dec 24, 2025): I submitted #6113 to hopefully fix this? not sure what other issues might be linked
Author
Owner

@tomzx commented on GitHub (Dec 31, 2025):

I'm still observing this as of 1.0.2211.0.222 when trying to reach http://localhost:10000.

Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
@tomzx commented on GitHub (Dec 31, 2025): I'm still observing this as of ~1.0.221~1.0.222 when trying to reach `http://localhost:10000`. ``` Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec. ```
Author
Owner

@sourman commented on GitHub (Jan 1, 2026):

@tomzx confirmed

@sourman commented on GitHub (Jan 1, 2026): @tomzx confirmed
Author
Owner

@sourman commented on GitHub (Jan 1, 2026):

investigated a bunch and found that the _headers file I added in #6113 exists in packages/app/public/_headers and is copied to dist/_headers during build
For some reason Cloudflare Pages is serving _headers as a static asset instead of reading it as configuration

Since JavaScript files are missing the Content-Type: application/javascript header browsers refuse to run the javascript

I have not found any Cloudflare Pages announced incident regarding this. Really not sure why Cloudflare would stop parsing the _headers file properly

@sourman commented on GitHub (Jan 1, 2026): investigated a bunch and found that the _headers file I added in #6113 exists in packages/app/public/_headers and is copied to dist/_headers during build For some reason Cloudflare Pages is serving _headers as a static asset instead of reading it as configuration Since JavaScript files are missing the Content-Type: application/javascript header browsers refuse to run the javascript I have not found any Cloudflare Pages announced incident regarding this. Really not sure why Cloudflare would stop parsing the _headers file properly
Author
Owner

@sourman commented on GitHub (Jan 1, 2026):

EDIT Jan 4 2026:
No longer needed. issue is fixed in prod


I created a local temp workaround if anyone is running into this
you can git clone and then bun build a new binary which will modify the MIME type correctly which then allows the browser to run the JS https://github.com/sourman/opencode/tree/fix/cloudflare-mime-type-workaround

@sourman commented on GitHub (Jan 1, 2026): EDIT Jan 4 2026: No longer needed. issue is fixed in prod ---- I created a local temp workaround if anyone is running into this you can git clone and then bun build a new binary which will modify the MIME type correctly which then allows the browser to run the JS https://github.com/sourman/opencode/tree/fix/cloudflare-mime-type-workaround
Author
Owner

@penso commented on GitHub (Jan 2, 2026):

Same issue here with 1.0.223:

TypeError: 'application/octet-stream' is not a valid JavaScript MIME type.

An e2e test for this in the CI would be welcome, since it seems it happened more than once if I look at history.

@penso commented on GitHub (Jan 2, 2026): Same issue here with 1.0.223: ``` TypeError: 'application/octet-stream' is not a valid JavaScript MIME type. ``` An e2e test for this in the CI would be welcome, since it seems it happened more than once if I look at history.
Author
Owner

@whats0n0 commented on GitHub (Jan 2, 2026):

Still broken on 1.0.223 @adamdotdevin

@whats0n0 commented on GitHub (Jan 2, 2026): Still broken on 1.0.223 @adamdotdevin
Author
Owner

@sourman commented on GitHub (Jan 4, 2026):

Looks like the proxy was fixed in prod. Thanks whoever fixed the MIME types

@sourman commented on GitHub (Jan 4, 2026): Looks like the proxy was fixed in prod. Thanks whoever fixed the MIME types
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3402