Skip to content
PHP and Laravel3 min read

Laravel "Vite manifest not found": causes and fixes

Vite manifest not found at: /home/user/myapp/public/build/manifest.json

Short answer

The error means Laravel couldn't find public/build/manifest.json, the file Vite writes when it builds your CSS and JavaScript. Usually npm run build was never run for production, or public/build wasn't uploaded because Git ignores it. Run npm ci and npm run build, or build on your computer and upload the folder.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. What the error means
  2. Common causes
  3. How to fix it
  4. Prevention
  5. On ArabyHost

This usually appears the first time you open the site after deploying, even though everything worked on your machine. The @vite directive in Blade reads a manifest file to learn the names of the built CSS and JavaScript files; when it can’t find it, the whole page fails with a 500 error.

What the error means

npm run build bundles and minifies resources/css and resources/js, writes the output to public/build/assets with hashed names such as app-4f2a9c.js, then writes public/build/manifest.json mapping each source file to its new name. Laravel reads that file on every page. The message shows the exact path it searched, so compare it with where your project lives.

Common causes

  • The build step never ran for production.
  • public/build is in Laravel’s default .gitignore, so it doesn’t arrive with a GitHub deploy.
  • You moved the contents of public into public_html, while Laravel still looks in myapp/public/build.
  • The build failed because npm install broke, for example with Cannot find module or ERESOLVE, so no manifest was written.
  • A custom buildDirectory in vite.config.js that doesn’t match what Laravel expects.

How to fix it

  1. Build the assets from the project folder, locally or on the server if it has Node.js:
npm ci
npm run build

npm ci installs exactly what package-lock.json lists. Afterwards you should see public/build/manifest.json and a public/build/assets folder. 2. No Node.js on the server? Run both commands on your computer, zip the public/build folder, then in cPanel open Files › File Manager, upload it into myapp/public and choose Extract. Repeat after every CSS or JavaScript change. 3. Delete public/hot from the server if it exists. npm run dev creates it, and while it’s there Laravel requests assets from the local Vite dev server instead of the built files. 4. Fix the document root: the cleanest setup points the domain’s document root to myapp/public instead of copying its contents into public_html, so Laravel finds the manifest where it expects it. 5. If the message becomes Unable to locate file in Vite manifest, add the file to input in vite.config.js:

laravel({
    input: ['resources/css/app.css', 'resources/js/app.js'],
    refresh: true,
}),
  1. In tests, you can skip Vite entirely inside the test:
$this->withoutVite();

Prevention

  • Make npm ci && npm run build a fixed deploy step, as in the Laravel deployment guide.
  • Never upload public/hot or node_modules to the server.
  • If you deploy from GitHub without Node.js on the server, build in GitHub Actions or locally and commit the output to your deploy branch; see deploying from GitHub.

On ArabyHost

AI/Developer plans include Node.js 20 and 24 with SSH, Composer and Git, so you can run npm ci && npm run build on the server after each pull. Shared and WordPress plans have no SSH: build on your computer and upload the files as a ZIP or through Git deployment. Either way, the domain’s document root should point to public. The Araby AI assistant reads the error log and shows the path Laravel searched. See Laravel hosting.

FAQ

Why does it work locally but fail on the server?

Locally you run npm run dev, so Vite serves files directly without a manifest. On the server Laravel looks for built files in public/build, and that folder is ignored by Git by default.

Do I need Node.js on the server?

Not necessarily. You can build with npm run build on your computer and upload public/build. Node.js on the server only helps if you want to build there after every Git pull.

What does "Unable to locate file in Vite manifest" mean?

The manifest exists, but the file you passed to @vite isn't listed in it. Add the file to the input array in vite.config.js and rebuild.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.