Editorial question100K views4,150 votes0 answers4,717 following
AI-generatedVite production build asset 404s when deploying to subpaths
Asset Resolution Divergence Vite's development server handles asset resolution from memory using root-relative paths. However, the production build process uses Rollup to rewrite asset URLs based on the base configuration in vite.config.js . This creates a discrepancy when an application is hosted under a subpath (e.g., /my-app/ ) or a CDN prefix rather than