Skip to content
Latchkey

Laravel: Vite Manifest Not Found in CI

Laravel's @vite directive reads public/build/manifest.json to resolve hashed asset paths. When CI renders a view before npm run build, the manifest does not exist and Laravel throws "Vite manifest not found" (or "Unable to locate file in Vite manifest").

What this error means

A view-rendering test or page in CI fails with "Vite manifest not found at: .../public/build/manifest.json" or "Unable to locate file in Vite manifest". The Node build step did not run before the PHP step.

php
Illuminate\Foundation\ViteManifestNotFoundException:
Vite manifest not found at: /app/public/build/manifest.json
at vendor/laravel/framework/src/Illuminate/Foundation/Vite.php:...

Common causes

Assets were not built before the PHP step

The @vite directive needs public/build/manifest.json, which only exists after npm run build. Running PHP first means it is missing.

The manifest is gitignored and not produced

public/build/ is a build artifact (gitignored). Without the Node build step, CI never creates the manifest.

How to fix it

Build Vite assets before running PHP

php
npm ci
npm run build   # writes public/build/manifest.json
php artisan test

Use Vite dev-server detection or skip in tests

For backend-only tests, avoid rendering @vite views, or run the Vite build once before the suite.

php
// Vite::useHotFile / withoutVite() in tests that do not need assets
\$this->withoutVite();

Confirm the build output path

  1. Check vite.config.js builds into public/build with a manifest.
  2. Order the workflow so the Node build precedes PHP view rendering.
  3. If on the older Mix pipeline, use the Mix manifest guide instead.

How to prevent it

  • Run npm ci && npm run build before any PHP step that renders @vite views.
  • Use withoutVite() in tests that do not exercise assets.
  • Treat public/build/manifest.json as a required CI build artifact.

Frequently asked questions

What causes ""Vite manifest not found""?
The @vite directive needs public/build/manifest.json, which only exists after npm run build. Running PHP first means it is missing.
How do I fix "Vite manifest not found"?
Build Vite assets before running PHP

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card