skip to Main Content

Laravel Jetstream Livewire Vite Cpanel Deployment
My SetUp:

Laravel: v9.22.1
PHP: v8.1.8

Everything works perfectly on local enviorement but when I deploy the app on Cpanel I get this error:

Unable to locate file in Vite manifest: resources/css/app.css.

I think is something related with Vite because if I dont run npm run build in my local it shows the same error:

Unable to locate file in Vite manifest: resources/css/app.css.

I

2

Answers


  1. Chosen as BEST ANSWER

    In my chase this problem was caused because in my manifest inside the build folder I had this error :

    ![problem][1] [1]: https://i.stack.imgur.com/2jAVk.png

    Correcting the to /

    {
      "resources/js/app.js": {
        "file": "assets/app.ab93cf8a.js",
        "src": "resources/js/app.js",
        "isEntry": true
      },
      "resources/css/app.css": {
        "file": "assets/app.9fa9f508.css",
        "src": "resources/css/app.css"
      }
    }
    

    fix the problem.


  2. For me was:
    When i used in view

    @vite(['resources/scss/style.scss'])
    

    I had to add in vite.config.js corresponding path

    import { defineConfig } from 'vite';
    import laravel from 'laravel-vite-plugin';
    
    export default defineConfig(
    {
        plugins: [
            laravel({
                input: [
                    'resources/admin/scss/style.scss',
                    'resources/css/app.css',
                    'resources/js/app.js',
                ],
                refresh: true,
            }),
        ],
    });
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search