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".
Illuminate\Foundation\ViteManifestNotFoundException
Vite manifest not found at: .../public/build/manifest.jsonCommon 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
- Set up Node and run
npm ci. - Run
npm run buildto produce the manifest. - Run the test step after the manifest exists.
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npm run build
- run: php artisan testPrevent 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.
$this->withoutVite();How to prevent it
- Run
npm ci && npm run buildbefore rendering views in CI. - Cache node_modules and the build output where possible.
- Use
withoutVite()in tests that do not need built assets.