Laravel: "Vite manifest not found at manifest.json" - What To Do?

Have you ever seen the error "Vite manifest not found at manifest.json" in your Laravel project? A few things can cause this error, so let's quickly overview them.


Reason 1: You Forgot to Run Compiling

The number one thing you should check - did you run the compiling command.

npm run build
// or
npm run dev

This builds the assets and compiles them for use:

Once that is done - you should be able to open the website and see it working.


Reason 2: No Assets in the build folder

If you just deployed your project from any version control system (like GitHub), you might notice that the build folder is missing. This is because it is ignored by default:

.gitignore

# ...
 
/public/build
 
# ...

This prevents you from accidentally pushing dev builds on your server. To fix this, you have to run the commands on your server:

npm install
npm run build

Once that is done - you should see your build folder with all the assets.


Reason 3: Something is Wrong with Installed Packages

This one is a little bit tricky to debug, so the best scenario is to delete the node_modules folder and reinstall all the packages:

rm -rf node_modules
npm install
npm run build

Once that is done - attempt to see if everything generated as it should.

avatar

This also happens by default on a Laravel Forge server. I'm sure I found an article somewhere that aided by updating the deployment script instead of going the .gitignore #/public/build method. Anyhow, I tried that now and I get sh: 1: vite: not found which I guess means my Laravel Forge environment isn't Vite friendly :-(

ps. Please check this introductory sentence in this post:

Have you ever seen the error "Vite manifest not found at manifest.json" in your Laravle

avatar

Oh my, sorry about the typo!

As for the issue - yeah, this is a new one that recently came. Will take a look at it

avatar

i'm trying to install older laravel version (9) with jetstream and livwire i still face this issue

Like our articles?

Become a Premium Member for $129/year or $29/month
What else you will get:
  • 68 courses (1183 lessons, total 43 h 18 min)
  • 90 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord

Recent New Courses