Skip to content

Conversation

@monotykamary
Copy link
Contributor

Summary

  • Fixes MIME type errors when loading the web interface via opencode web
  • Adds automatic Content-Type header detection based on file extension when proxying responses from app.opencode.ai

Problem

When running opencode web, the browser console shows:

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.

This happens because Cloudflare doesn't return Content-Type headers for static assets served from app.opencode.ai.

Solution

The proxy handler now detects file extensions (.js, .css, .wasm, etc.) and adds the appropriate Content-Type header to the response before returning it to the browser.

Cloudflare doesn't return Content-Type headers for static assets served
from app.opencode.ai, causing browsers to reject module scripts with
MIME type errors. This adds automatic Content-Type detection based on
file extension when proxying responses.
@monotykamary
Copy link
Contributor Author

even though i'm a TUI guy, we gotta save the web @adamdotdevin @rekram1-node

@adamdotdevin adamdotdevin merged commit dc85863 into anomalyco:dev Jan 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants