opencode web mode broken: empty page - multiple versions and multiple os
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
Operating System
mac os 15.16.1, ubuntu 24.04
Terminal
iterm, gnome-terminal
I'm facing the exact same problem
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
this should be fixed now, lmk if you see it again
Closing, the issue here was that the server was sometimes cached and not using latest version.