Home > front end >  Laravel 9 Inertiajs Vite not loading assets on Shared hosting
Laravel 9 Inertiajs Vite not loading assets on Shared hosting

Time:12-18

I have deployed my laravel 9 with Inertia.js & Vite to my shared hosting acccount but screen was blank because vite cannot load assets after running npm run build.

Error thrown by vite

Vite manifest not found at: /home/ljsharp1/fmcosmetics.ljsharp.com/public/build/manifest.json

How can I fix this issue please?

CodePudding user response:

I have decided to migrate from vite to mix and it worked fine on the shared server. If it is a bad idea, please give your suggestion. Thanks.

CodePudding user response:

It looks like you are running into an issue with the asset compilation process in Vite. The error message "Vite manifest not found at: /home/ljsharp1/fmcosmetics.ljsharp.com/public/build/manifest.json" indicates that Vite is unable to find the manifest file, which is generated after running the build process.

There are a few things you can try to fix this issue:

  1. Make sure that you have run the build process correctly by running the npm run build command in your project directory. This should generate the necessary assets and create the manifest file.

  2. Check the permissions on the build directory to make sure that Vite has the necessary permissions to access and read the files.

  3. If you have made any changes to your Vite configuration, such as the output directory or the public path, make sure that these changes are reflected in the vite.config.js file.

  4. If none of these solutions work, try clearing the cache and rebuilding the project. You can do this by running the following command: npm run build -- --clean.

  • Related