Laravel says Vite manifest not found at public/build/manifest.json
Vite manifest not found at: /var/www/app/public/build/manifest.jsonShort answer
Laravel's @vite directive looks for a running dev server first, then for a built manifest file. If neither exists you get this error. Run npm run dev while developing, or npm install and npm run build before you deploy. Tests need withoutVite(), and a custom build directory must match on both sides.
Fix it fast
1Find out which cause you have
Check whether a build exists and whether a dev server is meant to be running. The listing tells you which of the causes below you are in.
ls -la public/build public/hot2Match what you see, then jump to its fix
- 1
public/build is missing or has no manifest file, and no dev server is runningAssets were never built for this environmentFix - 2
The page works in the browser, but a feature test that renders a view fails with the exceptionThe error appears only when running testsFix - 3
public/build is absent but another folder such as public/bundle holds the filesA custom build directory or manifest name does not matchFix
- 1
What does the error look like?
Vite manifest not found at: /var/www/app/public/build/manifest.json
Cause 1 of 3
Assets were never built for this environment
1Check
A fresh clone, a new server or a Docker image does not contain compiled assets. Laravel's docs say the dev server serves assets while you work and that the build command produces the versioned files for production.
ls public/build2Fix
Install the frontend packages, then build once. In development you can run the dev server instead and leave it running.
npm install
npm run build
# or, for local work only:
npm run dev3Verify
The build folder now holds the manifest, and the page loads.
ls public/buildConfirmed by laravel.com
Cause 2 of 3
The error appears only when running tests
1Check
While tests run, Laravel's Vite integration tries to resolve your assets, so it needs either the dev server or a build.
grep -rn "withoutVite" tests/ | head2Fix
Call withoutVite() in the test, or once in setUp() of your base TestCase, so Vite is mocked.
// tests/TestCase.php
protected function setUp(): void
{
parent::setUp();
$this->withoutVite();
}3Verify
Run the failing test again.
php artisan testConfirmed by laravel.com
Cause 3 of 3
A custom build directory or manifest name does not match
1Check
The directory and manifest file name can be changed in vite.config.js (buildDirectory and build.manifest). If the Blade side still uses the defaults, Laravel looks in the wrong place.
grep -n -E "buildDirectory|manifest" vite.config.js
grep -rn "useBuildDirectory\|useManifestFilename" app/ resources/2Fix
Make both sides agree: either remove the custom values, or pass the same build directory to the @vite directive or to Vite::useBuildDirectory().
// vite.config.js
laravel({
input: ['resources/js/app.js'],
buildDirectory: 'bundle',
}),
{{-- Blade --}}
@vite('resources/js/app.js', 'bundle')3Verify
Rebuild and reload the page.
npm run buildConfirmed by laravel.com
How do I stop it coming back?
- Put npm ci and npm run build into the deploy script, before the release goes live.
- Call withoutVite() in the base test case if your tests do not need real assets.
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
Laravel mix() throws Unable to locate Mix file
Unable to locate Mix file: /css/app.css.
This error means mix-manifest.json exists but has no entry for the path you passed to mix().
4 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 fix