Fix GitHub Pages deployment MIME type and 404 errors#6
Merged
Conversation
- Add .nojekyll to prevent Jekyll processing and MIME type conflicts - Add 404.html page for proper error handling and SPA routing - Add web.config for explicit MIME type configuration - Update vite.config.ts with proper build settings for GitHub Pages These changes fix: - JavaScript module MIME type errors (application/octet-stream → text/javascript) - 404 errors for favicon.svg and other static assets - SPA routing issues on GitHub Pages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Problem Fixed
After deploying the light theme changes, the site had two critical issues:
Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "application/octet-stream"/favicon.svg:1 Failed to load resource: the server responded with a status of 404🛠️ Solutions Implemented
1. MIME Type Configuration
.nojekyll: Prevents GitHub Pages from processing files through Jekyll, which was causing MIME type mismatchesweb.config: Explicit MIME type mappings for.js,.mjs,.svg,.cssfilesvite.config.ts: Proper build configuration for GitHub Pages deployment2. Error Handling & Routing
404.html: Custom 404 page that redirects to SPA router for proper single-page application handling3. Build Optimization
rollupOptionsto prevent chunk splitting issuesassetsDirconfiguration for consistent asset paths🧪 How This Fixes the Issues
MIME Type Error:
.nojekyllprevents GitHub Pages from interfering with file servingweb.configexplicitly tells the server to serve.jsfiles withtext/javascriptMIME type404 Error:
404.htmlcatches any missing resource requests and redirects appropriatelyfavicon.svg🚀 Deployment Notes
These changes are specifically designed for GitHub Pages hosting and will resolve the production deployment issues without affecting development mode.
✅ Testing
.nojekyllfile is included in build outputweb.configMIME type mappings🤖 Generated with Claude Code