Laravel: The Mix Manifest Does Not Exist in CI
Laravel Mix writes public/mix-manifest.json mapping source assets to compiled, versioned files. The mix() helper reads it. When CI renders a view (or runs a test that does) before npm run build/npm run prod, the manifest is absent and Laravel throws "The Mix manifest does not exist".
What this error means
A view-rendering test or page in CI fails with "The Mix manifest does not exist." public/mix-manifest.json is missing because the asset build step did not run before the PHP step.
Illuminate\Foundation\MixManifestNotFoundException:
The Mix manifest does not exist.
at vendor/laravel/framework/src/Illuminate/Foundation/Mix.php:64Common causes
Assets were not built before the PHP step
The PHP step ran before npm run build, so mix-manifest.json does not exist yet when mix() is called.
The manifest is gitignored and not produced in CI
public/mix-manifest.json is a build artifact (gitignored). Without the build step, CI never creates it.
How to fix it
Build assets before running PHP
Run the Node build step ahead of any view rendering.
npm ci
npm run build # or: npm run prod
php artisan testSkip mix() in tests that do not need assets
For pure backend tests, avoid rendering views that call mix(), or stub the manifest.
// tests can write a minimal manifest if a view requires it
File::put(public_path('mix-manifest.json'), '{}');Confirm the manifest path
- Check the build outputs to
public/and writesmix-manifest.json. - Order the workflow so Node build precedes PHP steps that render views.
- If migrated to Vite, use the Vite manifest guide instead.
How to prevent it
- Run
npm ci && npm run buildbefore any PHP step that renders views. - Treat
mix-manifest.jsonas a required build artifact in CI. - Avoid rendering asset-dependent views in pure backend tests.