Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

Laravel mix() fails with 'The Mix manifest does not exist'

ErrorThe Mix manifest does not exist.

Short answer

The mix() helper reads mix-manifest.json to find the hashed asset name, and that file only appears after Mix has compiled your assets. Run npm install and npm run dev or prod. If the file exists, the path you pass to mix() must match an output path in webpack.mix.js exactly.

  • Applies to Laravel 8, Laravel Mix 6, Node.js 22
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Look for the manifest, and compare what it lists with what the Blade view asks for.

    find . -name mix-manifest.json -not -path "./node_modules/*"
    grep -rn "mix(" resources/views | head
  2. 2Match what you see, then jump to its fix

    1. 1find prints nothing, and mix() throws The Mix manifest does not existAssets were never compiled on this machineFix
    2. 2mix-manifest.json exists but the page still fails for one particular assetThe path in mix() is not one Mix producedFix

What does the error look like?

  • The Mix manifest does not exist.

Cause 1 of 2

Assets were never compiled on this machine

1Check

The manifest is a build output. A fresh clone, or a deploy that ignores compiled files, does not have it. Check whether node_modules exists too.

ls node_modules | head -n 3
grep -n '"scripts"' -A8 package.json

2Fix

Install the Node dependencies and run the build script. npm run dev builds for development, npm run prod minifies.

npm install
npm run prod

3Verify

The manifest exists and lists your files.

find . -name mix-manifest.json -not -path "./node_modules/*"

Confirmed by laravel.com

Did this fix it?

Cause 2 of 2

The path in mix() is not one Mix produced

1Check

mix() looks the unhashed path up in the manifest. If webpack.mix.js writes to public/css/site.css, then mix('/css/app.css') has nothing to find.

grep -n "mix\." webpack.mix.js
grep -rn "mix(" resources/views

2Fix

Pass the same output path that webpack.mix.js writes, with a leading slash, relative to public.

// webpack.mix.js
mix.js('resources/js/app.js', 'public/js')
   .postCss('resources/css/app.css', 'public/css');

{{-- Blade --}}
<link rel="stylesheet" href="{{ mix('/css/app.css') }}">
<script src="{{ mix('/js/app.js') }}"></script>

3Verify

Rebuild, then load a page that uses the helper.

npm run prod
find . -name mix-manifest.json -not -path "./node_modules/*" -exec cat {} +

Confirmed by laravel-mix.com

Did this fix it?

How do I stop it coming back?

  • Build assets in CI or in the deploy script, not by hand on the server.
  • Keep the output paths in webpack.mix.js and the mix() calls in one place so they cannot drift.
  • Commit package-lock.json so npm install gives the same build everywhere.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.