Vite manifest not found

Vite manifest not found

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

Vite manifest not found

The error Vite manifest not found at: /home/???????/cart_shop/public/build/manifest.json is a classic deployment failure in Laravel applications using the laravel-vite-plugin. It usually indicates that the build assets generated during development are missing from the production environment, or more commonly, they are located in a path the server cannot reach.

When working with Vite in development, you run npm run dev, which watches for changes and compiles your code on-the-fly. In production, however, you must create a static bundle using npm run build. The output of this build process is placed in the build directory. Laravel expects to find the JSON manifest file—which maps asset hashes to their source files—in the path specified by your configuration.

The core issue described often stems from a misunderstanding of how shared hosting environments like cPanel handle file structure versus modern local development setups. You mentioned observing a change in directory sequence where the public folder moved from inside the project root to a location outside it, effectively becoming a sibling directory rather than a subdirectory. This structural shift breaks the default assumptions made by the laravel-vite-plugin.

By default, the plugin assumes your entry point resides at resources/js/app.js and that the compiled output lands in public/build. If you have moved your project structure—specifically if your web root is no longer aligned with where Laravel expects the build folder—the server returns a 404 because it cannot locate manifest.json relative to your current configuration.

Verifying the Build Process

Before adjusting paths, ensure that the build was actually executed successfully on the production server. The error message explicitly suggests checking if you ran npm install && npm run dev, but for production, the command must be npm run build.

Navigate to your project directory on the cPanel terminal (usually located at /home/username/public_html/cart_shop or wherever your actual root is) and run:

npm install
npm run build

If the build completes without errors, check if the build folder was created in the expected location. In a standard Laravel setup, this should be inside the public folder. If your directory structure has shifted such that public is now outside the project root, or if the build folder is missing entirely, the plugin cannot serve the assets.

Adjusting the Vite Configuration

If the build exists in a different location than expected, you must update your vite.config.js. The laravel() plugin accepts an outDir option to specify where the output should be generated. However, it is generally cleaner to adjust the input/output paths based on your actual file system structure rather than forcing Vite to look for files in non-existent directories.

If your project root is /home/username/public_html/cart_shop and you want the build output to reside at /home/username/public_html/cart_shop/public/build, ensure your configuration reflects this implicitly by default. If you have moved the entire public folder up a level, you might need to adjust the base path or explicitly set the output directory.

A common pattern when restructuring projects is to ensure the entry point still points to the correct file:

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    plugins: [
        laravel({
            input: 'resources/js/app.js',
            // Explicitly setting the output directory if it differs from default
            buildDir: 'public/build', 
            refresh: true,
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),
    ],
});

Handling Shared Hosting Constraints

Shared hosting environments like cPanel introduce specific constraints. When you restructure the file tree so that public is a sibling to the project root rather than a child, the URL paths change significantly. If your web server serves files from /home/username/public_html/cart_shop, but your Laravel application expects assets in a relative path that no longer resolves correctly due to the folder move, you may need to adjust the base path of your Vue app or ensure the manifest.json is generated at the exact URL route Laravel anticipates.

If you cannot physically move folders back to the standard structure, you must explicitly tell Vite where to write the output. The buildDir option in the plugin configuration allows you to define a custom location for the manifest and assets. This ensures that when Laravel tries to load /public/build/manifest.json, it finds the file exactly where your build process placed it.

Always verify the contents of the generated manifest on the server using a tool like ls -la public/build or cat public/build/manifest.json. If the file is empty or missing, the build step likely failed silently due to path resolution issues in the shared environment. For complex restructuring tasks, consulting official documentation at https://laravelcompany.com can provide further guidance on asset management in Laravel, though standard Vite configuration adjustments usually suffice for directory moves.

Our network