Solving Vite Manifest Not Found. It has a laravel logo and Vite logo and plus in between. Below it has a screenshot of error.
| |

Fix Vite Manifest Not Found Issue in Laravel: A Practical Guide – 3 Proven Solutions

Reading Time: 6 minutes

Hey, fellow artisans! 👋 Today, we will delve into a seemingly complex topic, but fear not, as we will simplify it for you..

In this guide, we will discuss Laravel and Vite, and how to effectively fix Vite Manifest Not Found issues related to manifest files. So, let’s get started on this exciting journey! 🚀

Solving Vite Manifest Not Found. It has a laravel logo and Vite logo and plus in between. Below it has a screenshot of error.

Understanding Laravel and Vite

So, there’s this cool thing called LARAVEL, which is like a toolbox for building awesome websites. It helps developers make websites quickly and easily. But sometimes, even the coolest tools have some hiccups.

Recently, Laravel transitioned from utilizing a tool called “Mix” to a new and improved tool called “Vite” in version 9.19. With this transition, some users began encountering an error message stating, “Vite manifest not found at: …/public/build/manifest.json.” This certainly sounds like a problem, doesn’t it??

Quick win #3: /vite-manifest-not-found/ (position 31.8). The pages ranking above you each cover only one or two causes, so the plan is a single page covering every cause. Below is a complete replacement article. If your current post has examples or screenshots you like, keep them inside the matching section.


Short answer: Laravel can’t find public/build/manifest.json, the file npm run build generates. Run npm install && npm run build on the machine serving the app. If the file exists and you still get the error, Laravel is looking in the wrong place or for an entry the build didn’t include. The sections below cover each case.

Which error do you have?

Error messageWhat it meansJump to
Vite manifest not found at: /var/www/app/public/build/manifest.jsonNo build exists where Laravel is lookingCauses 1–5
Unable to locate file in Vite manifest: resources/css/app.cssThe build exists but doesn’t contain that entryCauses 6–8
Error only in tests or CIViews render without built assetsCause 9

60-second diagnosis

Run these from your project root on the server where the error happens:

ls -la public/build/manifest.json        # does the manifest exist?
ls -la public/build/.vite/manifest.json  # Vite 5+ with an old plugin puts it here
ls -la public/hot                        # if this exists, Laravel expects the dev server
grep -n "input" vite.config.js           # which entries does the build include?
grep -rn "@vite" resources/views         # which entries do your views request?

Most cases are solved by comparing the last two outputs.

Cause 1: You never built the assets

The manifest only exists after a production build.

npm install
npm run build

Locally, keep npm run dev running instead. It creates public/hot, which tells Laravel to load assets from the Vite dev server rather than the manifest.

Cause 2: You deployed with Git, and public/build is gitignored

Laravel’s default .gitignore excludes /public/build, so git pull on the server never brings the manifest. Pick one fix:

  • Build on the server: add npm ci && npm run build to your deploy script.
  • Build in CI and ship the output: run the build in GitHub Actions and upload public/build with the release.
  • Upload it manually (shared hosting without Node): run npm run build locally and upload the whole public/build folder, including manifest.json.

Cause 3: Shared hosting where public/ became public_html/

If you moved Laravel’s public folder contents into public_html, your build lives at public_html/build. Laravel still looks in public_path('build'), which points to the old public/ folder.

The clean fix is not to move files at all: point the domain’s document root at Laravel’s public folder. I walk through that in Deploy Laravel 13 on Shared Hosting (Without Moving Files).

If you can’t change the document root, tell Laravel where the public folder is, in AppServiceProvider::register():

$this->app->usePublicPath(base_path('../public_html'));

Cause 4: Vite 5+ with an old laravel-vite-plugin

Vite 5 moved the manifest to build/.vite/manifest.json. Older laravel-vite-plugin versions (0.x) don’t move it back, so Laravel can’t find it. Check package.json: if you’re on vite ^5 or newer, upgrade the plugin and rebuild.

npm install laravel-vite-plugin@latest --save-dev
npm run build

Cause 5: Docker image built without the assets

In multi-stage builds, it’s easy to run npm run build in a Node stage and then never copy the output into the PHP image.

FROM node:20 AS assets
WORKDIR /app
COPY package*.json vite.config.js ./
COPY resources ./resources
RUN npm ci && npm run build

FROM php:8.3-fpm
# ...
COPY --from=assets /app/public/build ./public/build

Also check that a bind mount (e.g. .:/var/www) isn’t hiding public/build from the image at runtime.

Cause 6: The @vite entry isn’t in vite.config.js

Unable to locate file in Vite manifest: resources/css/app.css means your Blade asked for a file the build doesn’t include. These two lists must match exactly:

// vite.config.js
laravel({
    input: ['resources/css/app.css', 'resources/js/app.js'],
    refresh: true,
}),
@vite(['resources/css/app.css', 'resources/js/app.js'])

Common mismatches:

  • Renamed files. app.js became app.ts, app.jsx or app.tsx, but only one side was updated.
  • Case sensitivity. App.css works on macOS and Windows but fails on Linux servers.
  • A page-specific entry (e.g. resources/js/charts.js) used in one view but never added to input.

Rebuild after any change to input.

Cause 7: Inertia page components missing from the build

With Inertia, the root template often requests the current page component:

@vite(['resources/js/app.tsx', "resources/js/Pages/{$page['component']}.tsx"])

Each page must be part of the build. That happens through the glob in your app.tsx resolver:

resolve: (name) =>
    resolvePageComponent(`./Pages/${name}.tsx`, import.meta.glob('./Pages/**/*.tsx')),

If the glob’s extension or folder doesn’t match your files (.jsx vs .tsx, Pages vs pages), those pages are missing from the manifest.

Cause 8: A package’s assets, or a custom build directory

Package assets. Some packages call @vite with their own files, and that error names a file you don’t recognise. Follow the package’s install steps: usually publish its assets, or add its entry to your input array, then rebuild.

Custom build directory. If you set buildDirectory: 'bundle' in the Vite plugin, Laravel must use the same directory:

@vite(['resources/js/app.js'], 'bundle')

Alternatively, call Vite::useBuildDirectory('bundle') in a service provider.

Cause 9: Tests and CI fail with the manifest error

Feature tests that render views need either a build or no Vite at all. Disable Vite for tests in tests/TestCase.php:

protected function setUp(): void
{
    parent::setUp();
    $this->withoutVite();
}

For browser tests (Dusk), run npm ci && npm run build in the CI job before the test step. More on test configuration in Laravel phpunit.xml: Full Example + Every Setting.

FAQ

Do I need Node.js on my production server?

No. Run npm run build locally or in CI, then deploy the generated public/build folder. Node is only needed where the build runs.

Why does it work locally but not on the server?

Locally, npm run dev serves assets through public/hot, so no manifest is needed. On the server there’s no dev server, so Laravel needs public/build/manifest.json, which usually wasn’t deployed (Cause 2) or sits in the wrong folder (Cause 3).

Should I commit public/build to Git?

Generally no: it causes merge noise and stale assets. Build during deployment instead. On shared hosting without Node or CI, committing it is an acceptable trade-off.

I deleted public/hot and now get the manifest error. Why?

Without public/hot, Laravel switches to production mode and reads the manifest. Run npm run build once, or start npm run dev again.


Internal links: add a link from /laravel-13-shared-hosting/ to this page, with the anchor text “fix the Vite manifest error”, in its asset/Vite step. Also link here from /laravel-phpunit-xml/.

3 Proven Solutions to Fix Vite Manifest Not Found:

But fret not, for I have three effective solutions to help you resolving Vite manifest error issue. Let’s explore each solution in detail.

1. Fixing it on the Development Server

If you’re working on the development server (that’s like the testing playground for websites), you can fix it easily. Just open a magic box called the terminal and type two commands: npm install and npm run dev. This makes your website’s assets and manifest files behave themselves. It would start a development server

The development server automatically detects any changes made to your files and promptly reflects them in any open browser windows. In simpler terms, you no longer need to manually refresh the page to see the changes; the server takes care of it for you.

2. Fixing it on a Production Server with SSH

What if you’re on a production server with SSH powers (like having a super-secret key to control the server)? You can still fix it! Just run npm install && npm run build, and things will start working smoothly. The manifest file and assets will be ready to go.

By running the “build” command, your application’s assets will be versioned and bundled, ready for production deployment.

3. Fixing it on a Production Server without Fancy Stuff

But what if your production server is a bit old-school and doesn’t have fancy things like npm? No problem! You have two options:

  • You can upload the “build” folder manually using FTP or CPanel File Manager. It’s like sending a package in the mail.
  • Or, you can tell Git (that’s like a super-smart notebook for developers) to keep an eye on the “build” folder. Remove it from the “.gitignore” file, and Git will track it. But remember, don’t clutter up Git with lots of changes. Only commit the “build” folder when you’re finished with a big project or releasing the final version.

If you any doubts or want to learn more about using Vite with Laravel, You can check official docs about it on Laravel at Asset Bundling (Vite) – Laravel 10.x – The PHP Framework For Web Artisans

You may also like: Automate Laravel Migration and Recaching with Git Hook

Final Thoughts

So, there you have it! Three ways to fix the “Vite manifest not found at” problem in Laravel. It might seem a bit tricky, but once you get the hang of it, you’ll be a web development pro!

Remember, it’s okay to ask questions and learn new things. If you ever run into tech troubles, don’t hesitate to ask for help. We hope these tips help you on your web-building adventures. I would suggest you to also read about Automating Laravel Migration and Recaching with Git Hook.

Feel free to share your thoughts in the comments, and keep being awesome, young artisans of the digital world. Until next time, happy coding! 🚀

Fix Vite Manifest Not Found Issue in Laravel: A Practical Guide - 3 Proven Solutions

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome content in your inbox.

We don’t spam! Read our privacy policy for more info.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.