Vite manifest not found at: /css/custom.css/manifest.json

Updated: Feb 03, 2025

Vite manifest not found at: /css/custom.css/manifest.json

When building a web application using Vite, you might encounter an error message stating "Vite manifest not found at: /css/custom.css/manifest.json". This error occurs when Vite is unable to locate the manifest file for a specific asset. In this answer, we will discuss the possible causes and solutions for this issue.

Causes:

  1. Incorrect asset path: The most common cause of this error is an incorrect asset path. If the manifest file is not located in the expected directory, Vite will not be able to find it.
  2. Missing or deleted manifest file: Another possible cause is a missing or deleted manifest file. Manifest files are used to provide metadata about assets, such as their size, content type, and cache control headers. Without a manifest file, Vite will not be able to serve the asset correctly.
  3. Incorrect manifest file location: The manifest file should be located in the root directory of your project, or in a subdirectory named "public". If it is located elsewhere, Vite may not be able to find it.

Solutions:

  1. Check asset path: Make sure that the asset path in your code matches the actual location of the manifest file. For example, if your manifest file is located in the "public" directory, make sure that you reference it as "/public/manifest.json" instead of "/css/custom.css/manifest.json".
  2. Create or restore manifest file: If the manifest file is missing or deleted, you will need to create a new one or restore it from a backup. You can create a new manifest file by running the "vite build" command, which will generate a manifest file in the "dist" directory. Alternatively, you can restore the manifest file from a backup if you have one.
  3. Correct manifest file location: Make sure that the manifest file is located in the root directory or the "public" subdirectory of your project. If it is located elsewhere, move it to the correct location and update your code accordingly.

Conclusion:

The "Vite manifest not found at: /css/custom.css/manifest.json" error can be caused by an incorrect asset path, a missing or deleted manifest file, or an incorrect manifest file location. To resolve this issue, check the asset path, create or restore the manifest file, or correct the manifest file location as necessary. By following these steps, you should be able to get your Vite project up and running again.