How to Fix the Vite Manifest Not Found Error in Laravel

After upgrading to a newer version of Laravel that uses Vite, many developers suddenly get a white error page with the message: Vite manifest not found at: /path/public/build/manif...

How to Fix the Vite Manifest Not Found Error in Laravel

After upgrading to a newer version of Laravel that uses Vite, many developers suddenly get a white error page with the message:

Vite manifest not found at: /path/public/build/manifest.json

or another variant: "Unable to locate file in Vite manifest". This error appears because Laravel is looking for the built asset output (CSS/JS) that isn't available yet. The good news is that there are few causes and they are easy to fix. Let's go through them.

Why Does This Error Appear?

Since Laravel 9.19+, Laravel Mix was replaced by Vite. The @vite directive in Blade looks for the public/build/manifest.json file to know the names of the built asset files. If that file doesn't exist yet — because the assets haven't been built or the dev server isn't running — Laravel throws the error above.

Solution for Development Mode

When coding locally, you just need to run the Vite dev server. Open a second terminal (leave php artisan serve running in the first terminal), then:

npm install     # once, if you haven't
npm run dev

While npm run dev is active, Vite creates a public/hot marker file and serves the assets live. If you close the dev server, the error may reappear — just run it again.

Solution for Production Mode

On a production server, you do not run npm run dev. Instead, build the assets once so manifest.json is created permanently:

npm install
npm run build

This command produces a public/build/ folder complete with manifest.json. After that, the error disappears without Node needing to keep running.

A Common Problem on Shared Hosting

Many shared hosts don't provide Node.js, so npm run build can't be run on the server. The solution: build on your local machine, then upload the public/build/ folder to the server.

# locally
npm run build
# then upload the entire contents of public/build/ to public/build/ on the server

Make sure the public/build/ folder (including manifest.json) is uploaded and not included in .gitignore if you deploy via Git.

Check the @vite Configuration in Blade

Make sure your layout calls @vite with the correct path matching vite.config.js:

<!-- resources/views/layouts/app.blade.php -->
@vite(['resources/css/app.css', 'resources/js/app.js'])

The path inside @vite must match what is registered in vite.config.js:

// vite.config.js
export default defineConfig({
    plugins: [
        laravel({
            input: ['resources/css/app.css', 'resources/js/app.js'],
            refresh: true,
        }),
    ],
});

Quick Checklist

  • Development: did you run npm run dev?
  • Production: did you run npm run build and does the public/build/ folder exist?
  • Does the public/build/manifest.json file actually exist on the server?
  • Do the asset paths in @vite match vite.config.js?
  • Did you run npm install so the node_modules folder is available (for building)?

Conclusion

The "Vite manifest not found" error is not a bug, but a sign that the assets haven't been built. Locally, run npm run dev; in production, run npm run build (or upload the build output if the hosting has no Node). Once manifest.json is available, the page returns to normal. If you deploy to shared hosting, also check our guide on how to deploy Laravel to cPanel.

vite manifest not found unable to locate file in vite manifest error vite laravel npm run build laravel laravel vite
Read Also

Here are some related articles that might help expand your knowledge:

Share this article
Back to Blog
🚀 Partner Recommendation

Need Premium Source Code & Business Apps?

Access Laravel applications, POS systems, School Management, Clinic Software, ERP solutions, and ready-to-use premium source code at GudangCode.

GudangCode
  • ✔ Premium Source Code
  • ✔ Ready-to-Use Systems
  • ✔ Lifetime Updates
  • ✔ Lifetime Membership
  • ✔ Daily App Updates
Join Membership →