Regenerate Vite Manifest File
October 27, 2024 · AI Conversations
User
Vite manifest not found at: /var/www/html/public/build/manifest.json I accidently deleted
Assistant
If you accidentally deleted the `manifest.json` file generated by Vite in your Laravel application, you can regenerate it by rebuilding your assets. Here’s how:
1. **Navigate to Your Project Directory**:
Open your terminal and navigate to your Laravel project directory.
2. **Run Vite**:
Since you're using npm and Node.js, you can run Vite to rebuild your assets. Run:
npm run build
This will generate a new `manifest.json` file along with the necessary production assets in the `public/build` directory.
3. **Alternative – Run Development Server**:
If you're in a development environment and need the file for development purposes, you can start the Vite dev server instead:
npm run dev
This will generate the manifest as part of the development server, though it's temporary. For a permanent solution in production, the `npm run build` command will ensure the file is regenerated and saved.