Laravel cannot find a Sass or JS entry in the Vite manifest
Unable to locate file in Vite manifest: resources/sass/app.scssShort answer
The @vite directive asks the built manifest for a file, and that file is listed only if it is an entry in the laravel() input option and the assets were built after adding it. Make the path in @vite and in vite.config identical, then run npm run build, or keep npm run dev running while you work.
Fix it fast
1Find out which cause you have
Put the two lists side by side: the paths in @vite in your Blade layout and the input option in vite.config.js. Every path in @vite must also be in input.
grep -rn "@vite" resources/views grep -n "input" -A4 vite.config.js2Match what you see, then jump to its fix
- 1
The path in the message is missing from vite.config.js input@vite names a file that is not in the input listFix - 2
input is correct but the built manifest under public/build has no entry for the fileThe assets were built before the entry was added, or never builtFix - 3
The missing path is under resources/images or resources/fonts, used with Vite::asset()A static image or font is referenced but never passed through ViteFix
- 1
What does the error look like?
Unable to locate file in Vite manifest: resources/sass/app.scss
Cause 1 of 3
@vite names a file that is not in the input list
1Check
The Laravel plugin requires you to list the entry points of the application there, and they can be JS, CSS or preprocessed files such as Sass. The manifest contains the entries that were built, so anything else is not found.
grep -n "input" -A4 vite.config.js
grep -rn "@vite" resources/views2Fix
Add the file to input, or change @vite to a file that is listed. Make the strings match exactly.
// vite.config.js
laravel({
input: ['resources/sass/app.scss', 'resources/js/app.js'],
refresh: true,
})
{{-- layout --}}
@vite(['resources/sass/app.scss', 'resources/js/app.js'])3Verify
Build, then load the page.
npm run buildConfirmed by laravel.com
Cause 2 of 3
The assets were built before the entry was added, or never built
1Check
Production uses the manifest from the last npm run build. Changing vite.config.js does not update it by itself.
grep -n "app.scss" public/build/manifest.json2Fix
Rebuild for production, or run the dev server while you develop so Laravel does not use the manifest.
npm run build
# while developing
npm run dev3Verify
The manifest now lists the file.
grep -n "app.scss" public/build/manifest.jsonConfirmed by laravel.com
Cause 3 of 3
A static image or font is referenced but never passed through Vite
1Check
Static assets are processed by Vite when running npm run build, and Vite::asset() returns the versioned URL of those. A file that your JavaScript never imports is not in the manifest.
grep -rn "Vite::asset" resources/views2Fix
Import the folder in app.js with import.meta.glob so Vite processes the files, then build again.
// resources/js/app.js
import.meta.glob([
'../images/**',
'../fonts/**',
]);3Verify
Rebuild; the file appears in the manifest.
npm run build
grep -rn "images" public/build --include=*.jsonConfirmed by laravel.com
How do I stop it coming back?
- Define the entry list once and copy it to @vite when you add a file.
- Build assets in the deploy pipeline and keep public/build out of the repository.
- Run npm run build in CI so a missing entry fails before release.
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 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 fixWeb apps
tsconfig rejects allowImportingTsExtensions
An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly
allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.
2 causes, each with a fixWeb apps
Apollo Server rejects a request as a potential CSRF
HTTP 400 Bad Request from the GraphQL endpoint
Apollo Server's CSRF prevention is on by default.
3 causes, each with a fixWeb apps
React shows Attempted import error when importing a component or function
Attempted import error:
The build found the file but not the name you asked for.
2 causes, each with a fixWeb apps
AxiosError Network Error with code ERR_NETWORK in a React app
Network Error
ERR_NETWORK means the request produced no readable response.
4 causes, each with a fixWeb apps
Axios get works with a URL string but ignores the object passed as the second argument
The server log shows a GET with no query string
axios.get takes a URL and an optional config object.
3 causes, each with a fix