Skip to content
Latchkey

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.

php
Illuminate\Foundation\MixManifestNotFoundException:
The Mix manifest does not exist.
at vendor/laravel/framework/src/Illuminate/Foundation/Mix.php:64

Common 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.

php
npm ci
npm run build   # or: npm run prod
php artisan test

Skip mix() in tests that do not need assets

For pure backend tests, avoid rendering views that call mix(), or stub the manifest.

php
// tests can write a minimal manifest if a view requires it
File::put(public_path('mix-manifest.json'), '{}');

Confirm the manifest path

  1. Check the build outputs to public/ and writes mix-manifest.json.
  2. Order the workflow so Node build precedes PHP steps that render views.
  3. If migrated to Vite, use the Vite manifest guide instead.

How to prevent it

  • Run npm ci && npm run build before any PHP step that renders views.
  • Treat mix-manifest.json as a required build artifact in CI.
  • Avoid rendering asset-dependent views in pure backend tests.

Related guides

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