Vite manifest not found in Laravel: what the error really means
Laravel cannot find public/build/manifest.json, which means the front-end was never built on this machine. The fix is a build step, not a code change.
"Unable to locate file in Vite manifest" means Blade asked Vite for an asset hash and public/build/manifest.json does not exist or does not contain that entry. Almost always the deploy skipped npm run build.
Build assets as part of the deploy
Laravel ships without compiled assets. A fresh clone, a Forge deploy or a Docker image needs npm ci && npm run build before the first request. In CI, cache node_modules but never skip the build, and confirm public/build/manifest.json exists afterwards.
- npm ci --no-audit --no-fund
- npm run build
- ls public/build/manifest.json to verify
Hot file in the wrong place
During local development Vite writes public/hot, and Laravel reads it to point at the dev server. If a deploy copied that file, production tries to load assets from localhost:5173 and fails. Delete public/hot in the deploy step or exclude it from rsync.
An entry that is not in vite.config.js
The manifest only contains entries listed in the input array. @vite(["resources/js/editor.js"]) fails if editor.js was added to the Blade file but never to vite.config.js. Add the entry, rebuild, and confirm the key appears in manifest.json.
The build directory is ignored by Git
public/build is usually in .gitignore, which is correct — build on the server rather than committing artefacts. If your host cannot run Node, build locally and upload public/build as part of the release, and make sure the allowlist includes it.
Frequently asked questions
Do I need npm on the production server?
Only if you build there. Many teams build in CI and ship public/build with the release, which avoids installing Node on the server entirely.
Why does it work in local development but not after deploy?
Locally the Vite dev server is running and public/hot exists. After deploy neither is true, so the production branch of @vite needs a real manifest.
Can I clear the Vite cache?
There is no cache to clear — the manifest is read from disk on every request. If the file exists and the entry is present, check file permissions for the web user.
More on this topic: Laravel articles.
Admin
Related articles
Upgrading Laravel 10 to 12: a realistic one-week checklist
Two major versions at once is mostly mechanical: dependency updates, the new bootstrap file, and a test suite that tells you what...
Livewire or Inertia with Vue/React: which is cheaper to build and keep?
Livewire keeps one language and one deploy; Inertia buys a real component ecosystem at the cost of a second build pipeline. The ch...