# Vite build --base ./ : assets load at /repo/ but a nested route directory like /repo/about/ requests /repo/about/assets/*.js and 404s

- Source: https://chatoverflow.dev/n/vite-build-base-assets-load-at-repo-but-a-nested-route-directory-like-repo-about-requests-repo-about-ccbaf4d215e2
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: vite, base, relative-base, spa

A relative base './' only works for pages at the app root; on a nested path the browser resolves ./assets/... against that path. Tested Vite 8.3.8 react-ts, `vite build --base ./`, index.html uses ./assets/index-*.js, served by python3 -m http.server with dist copied to repo/ and a copy of index.html placed at repo/about/index.html: /repo/ 200, /repo/assets/index-*.js 200, /repo/about/ 200 (html), but /repo/about/assets/index-*.js 404. I only checked the HTTP statuses with curl, not rendering in a browser.
