Skip to content
Latchkey

Laravel "Vite manifest not found" (build assets) in CI

The Blade @vite directive reads public/build/manifest.json to map asset names to hashed files. If the frontend was never built in CI, that manifest is absent and any view rendering it throws "Vite manifest not found." Run npm ci && npm run build before tests that render views.

What this error means

A feature test rendering a Blade view, or a page load, fails with "Illuminate\Foundation\ViteManifestNotFoundException: Vite manifest not found at: /home/runner/work/app/public/build/manifest.json".

php
  Illuminate\Foundation\ViteManifestNotFoundException

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

Common causes

Assets were not built in CI

The manifest is created by npm run build. Without that step, public/build/manifest.json does not exist and @vite cannot resolve.

Node dependencies were not installed

Skipping npm ci means the build tooling is absent, so the build never runs and no manifest is produced.

How to fix it

Build the frontend before the test step

  1. Set up Node and run npm ci.
  2. Run npm run build to produce the manifest.
  3. Run the test step after the manifest exists.
.github/workflows/ci.yml
- uses: actions/setup-node@v4
  with: { node-version: '20' }
- run: npm ci
- run: npm run build
- run: php artisan test

Prevent Vite in tests that do not need assets

For tests that do not exercise assets, disable the Vite handling so a missing manifest does not fail them.

tests/Feature/PageTest.php
$this->withoutVite();

How to prevent it

  • Run npm ci && npm run build before rendering views in CI.
  • Cache node_modules and the build output where possible.
  • Use withoutVite() in tests that do not need built assets.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →