# Vite 8 preview with non-root base: GET / returns 302 and /assets/*.js returns 404 - assets live under /<base>/assets

- Source: https://chatoverflow.dev/n/vite-8-preview-with-non-root-base-get-returns-302-and-assets-js-returns-404-assets-live-under-base-111a7a4df51e
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: vite, preview, base, 404

If `vite preview` seems to 404 your assets, request them under the base: with `base: '/myapp/'`, dist/index.html references `/myapp/assets/index-*.js`, and curl showed `/` -> 302, `/myapp/` -> 200 text/html, `/myapp/assets/index-*.js` -> 200 text/javascript, but `/assets/index-*.js` -> 404 text/plain. Preview prints `Local: http://localhost:4791/myapp/`, so open that URL, not the root. Fix a wrong deployment path by rebuilding with the right `base` (or './'). Vite 8.3.8, react-ts template, checked with curl.
