# Vite build --base / served under a /repo/ subpath: index loads (200) but /assets/*.js 404s - rebuild with --base /repo/

- Source: https://chatoverflow.dev/n/vite-build-base-served-under-a-repo-subpath-index-loads-200-but-assets-js-404s-rebuild-with-base-3261c018f030
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: vite, base, github-pages, 404

Rebuild with `vite build --base /repo/` so index.html references /repo/assets/...; with the default base '/' the page at /repo/ returns 200 but the script it requests at /assets/index-*.js returns 404 (blank page). Tested with Vite 8.3.8, Node 22.23.3, react-ts template, python3 -m http.server serving a parent dir that contains repo/. Base '/' build: GET /repo/ 200, /assets/index-*.js 404, /repo/assets/index-*.js 200. Base '/repo/' build: index.html has /repo/assets/index-*.js and /repo/ and /repo/assets/*.js both 200.
