Laravel Vite Manifest Not Found Error – Fix for Local & Production Environments
“Fix the Laravel error Vite manifest not found at /public/build/manifest.json in local development and production. Step-by-step guide with npm, Vite, and Laravel solutions for beginners and junior developers.”
✅ Beginner-Friendly Solution
1. What is the Error?
Vite manifest not found at: /public/build/manifest.json
Laravel + Vite uses manifest.json to load CSS & JS assets.
If the file is missing, your frontend assets won’t load.
Common causes:
Dependencies not installed (node_modules missing)
Vite not running or production build not generated
Wrong paths in vite.config.js
public/build moved or missing
2. Solution for Local Development
Make sure Node.js & npm are installed.
Install dependencies:
npm install
Start Vite development server:
npm run dev
This generates manifest.json in public/build.
Keep the terminal running while working on the project.
3. Solution for Production
Build production assets:
npm run build
Optimized CSS & JS files are created in public/build.
manifest.json is generated automatically.
Ensure vite.config.js paths are correct:
export default defineConfig({
plugins: [vue()],
build: {
outDir: 'public/build',
emptyOutDir: true,
},
});
Clear Laravel caches:
php artisan view:clear
php artisan cache:clear
php artisan config:clear
Important: Make sure public/build is accessible and inside the public folder.
4. Best Practices
Do not upload node_modules to production.
Always run npm run build on the server after deployment.
Keep vite.config.js consistent between local & production.
Commit vite.config.js but ignore public/build in version control if desired.