Laravel mix() throws Unable to locate Mix file
Unable to locate Mix file: /css/app.css.Short answer
This error means mix-manifest.json exists but has no entry for the path you passed to mix(). Open the manifest and compare. Fix the path in the view, rebuild so the manifest lists the file, or tell mix() which folder holds the manifest. With app.debug off, Laravel only logs it.
Fix it fast
1Find out which cause you have
Print the manifest and see which keys it contains. The path in the error must appear as a key.
cat public/mix-manifest.json2Match what you see, then jump to its fix
- 1
The manifest has a key like /js/app.js but the view asks for another nameThe path in the view differs from the key in the manifestFix - 2
The file you need is not in the manifest at allThe manifest is out of date: the asset was never compiledFix - 3
The assets are built into public/<folder> and mix() cannot find themThe manifest lives in a sub-folderFix - 4
Production works, local environment throwsThe page shows the error only in developmentFix
- 1
What does the error look like?
Unable to locate Mix file: /css/app.css.
Cause 1 of 4
The path in the view differs from the key in the manifest
1Check
mix() puts a leading slash on the path you give it and looks that exact string up in the manifest. A typo, a different folder or a different file name finds nothing.
grep -rn "mix(" resources/views2Fix
Use the path exactly as it appears in the manifest, minus the leading slash.
<link rel="stylesheet" href="{{ mix('css/app.css') }}">
<script src="{{ mix('js/app.js') }}"></script>3Verify
Reload the page. The tags should render with a ?id= version.
curl -s http://localhost:8000 | grep "app\."Confirmed by raw.githubusercontent.com
Cause 2 of 4
The manifest is out of date: the asset was never compiled
1Check
Compiling writes the manifest. A new entry in webpack.mix.js, or a deploy that copied code without a build, leaves it without that file.
grep -n "mix\." webpack.mix.js
ls -l public/mix-manifest.json2Fix
Make sure webpack.mix.js declares the output, then compile again.
// webpack.mix.js
mix.js('resources/js/app.js', 'public/js')
.postCss('resources/css/app.css', 'public/css');
# then, in the shell
npm install
npx mix3Verify
The new file should now appear in the manifest.
cat public/mix-manifest.jsonConfirmed by laravel-mix.com
Cause 3 of 4
The manifest lives in a sub-folder
1Check
mix() reads public/mix-manifest.json unless you pass a second argument. The framework source builds the manifest location from that argument.
find public -name mix-manifest.json2Fix
Pass the folder that holds the manifest as the second argument.
{{ mix('css/app.css', 'build') }}3Verify
The tag should render with the versioned URL.
curl -s http://localhost:8000 | grep "build/"Confirmed by raw.githubusercontent.com
Cause 4 of 4
The page shows the error only in development
1Check
The framework source throws this exception when app.debug is true. When app.debug is false it reports the exception and returns the plain unversioned path, so the problem can hide in production logs.
grep -n "APP_DEBUG" .env; grep -n "Unable to locate Mix file" storage/logs/laravel.log2Fix
Fix the missing manifest entry as in the causes above. Do not rely on debug mode being off.
php artisan config:clear3Verify
No new entry appears in the log after loading the page.
tail -n 20 storage/logs/laravel.logConfirmed by raw.githubusercontent.com
How do I stop it coming back?
- Build assets in the deploy pipeline before the release goes live.
- Keep the mix() paths in views in step with webpack.mix.js outputs.
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- WorkforceA field app, an admin console and a self-hosted Node.js server for push and reconciliation.
- Spotless LaundryAn on-demand laundry app: Flutter on a Laravel back end, with Firebase for live updates.
Related fixes
Back end
Laravel mix() fails with 'The Mix manifest does not exist'
The Mix manifest does not exist.
The mix() helper reads mix-manifest.json to find the hashed asset name, and that file only appears after Mix has compiled your assets.
2 causes, each with a fixBack end
npm run production fails in Laravel Mix with an unknown --hide-modules option
Unknown argument: --hide-modules
The scripts in your package.json were written for Mix 5, which called webpack directly with flags such as --hide-modules.
3 causes, each with a fixBack end
Laravel npm run dev says the mix command was not found
Command "mix" not found when running npm run dev
The mix program comes from the laravel-mix package.
3 causes, each with a fixBack end
Browser does not reload when I save a Blade file under Vite
CSS and JavaScript hot update, but view changes need a manual refresh
Vite only reloads the page for Blade files when the Laravel plugin's refresh option is on.
3 causes, each with a fixBack end
npm run dev in Laravel cannot find vite.js
npm run dev exits right after starting, with a module error
The dev script runs the vite command from node_modules.
3 causes, each with a fixBack end
Laravel says Vite manifest not found at public/build/manifest.json
Vite manifest not found at: /var/www/app/public/build/manifest.json
Laravel's @vite directive looks for a running dev server first, then for a built manifest file.
3 causes, each with a fix