laravellaravel-8laravel-mixfortifylaravel-jetstream

The Mix manifest does not exist - Laravel Fortify Jetstream Login/Registration Issue when deploying laravel in Hostgator shared hosting


I have been able to deploy Laravel projects successfuly in the past. For the first time I am using Laravel 8 with Jetstream and Livewire. Laravel is now using Fortify for login and registration auth.

My local server works perfect, no issues. After deploying the project to a Hostgator shared hosting account, my homepage loads correctly and reads and outputs data from my DB correctly.

However, when I try to access

mydomain.com/login/ or mydomain.com/login or mydomain.com/register/ or mydomain.com/register

I get a 500 error. Below at the end of this question I am pasting the error log.

I have done the following:

  1. Updated composer version
  2. npm rebuild
  3. npm install
  4. I tried both: npm run dev and npm run production and re-uploaded everything in each scenario.
  5. I have pointed public/index.php path to the correct app folder to read the autoload.php and bootstrap/app.php files.
  6. I have chmod all folders and subfolders to 755 and all files to 644

I find it really strange that my homepage loads flawless and brings data from DB just fine, therefore I know that my .env file has the correct db connection credentials. Only the login and registration will throw a 500 error.

My env file:

APP_NAME=NameOfApp
APP_ENV=production
APP_KEY=base64:KeyGeneratedWhenProjectCreated
APP_DEBUG=false
APP_URL=http://domain
LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=db_works_good
DB_USERNAME=username_works_good
DB_PASSWORD=passwordWorksGood

Here is the laravel.log (shortened to what seems important):

[2020-11-30 20:25:34] production.ERROR: The Mix manifest does not exist. (View: /domain_root_path/app/resources/views/layouts/guest.blade.php) (View: /domain_root_path/app/resources/views/layouts/guest.blade.php) {"exception":"[object] (ErrorException(code: 0): The Mix manifest does not exist. (View: /domain_root_path/app/resources/views/layouts/guest.blade.php) (View: /domain_root_path/app/resources/views/layouts/guest.blade.php) at /domain_root_path/app/vendor/laravel/framework/src/Illuminate/Foundation/Mix.php:46)
[stacktrace]
#0 /domain_root_path/app/vendor/livewire/livewire/src/CompilerEngine.php(38): Illuminate\\View\\Engines\\CompilerEngine->handleViewException(Object(ErrorException), 0)
#1 /domain_root_path/app/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(60): Livewire\\CompilerEngine->handleViewException(Object(ErrorException), 0)
#2 /domain_root_path/app/vendor/livewire/livewire/src/LivewireViewCompilerEngine.php(32): Illuminate\\View\\Engines\\PhpEngine->evaluatePath('/home2/usr2...', Array)
...................
#52 /domain_root_path/public_html/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#53 {main}
[previous exception] [object] (Exception(code: 0): The Mix manifest does not exist. at /domain_root_path/app/vendor/laravel/framework/src/Illuminate/Foundation/Mix.php:46)
[stacktrace]




#0 /domain_root_path/app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(506): Illuminate\\Foundation\\Mix->__invoke('/css/app.css')
#1 /domain_root_path/app/storage/framework/views/f25b68bee7f180a7da8624828693071be98325dc.php(14): mix('css/app.css')
#2 /domain_root_path/app/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(107): require('/home2/usr2...')
............................................
#66 {main}

THE STRUCTURE OF FILES:

root has two folders:

My index.php (inside public) has the following paths:

require __DIR__.'/../app/vendor/autoload.php';

$app = require_once __DIR__.'/../app/bootstrap/app.php';

GUEST.BLADE.PHP looks like this: (please note that this file was auto-generated by Laravel and I have not touched it)

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="csrf-token" content="{{ csrf_token() }}">

        <title>{{ config('app.name', 'Laravel') }}</title>

        <!-- Fonts -->
        <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap">

        <!-- Styles -->
        <link rel="stylesheet" href="{{ mix('css/app.css') }}">

        <!-- Scripts -->
        <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.7.3/dist/alpine.js" defer></script>
    </head>
    <body>
        <div class="font-sans text-gray-900 antialiased">
            {{ $slot }}
        </div>
    </body>
</html>

/public/mix-manifest.json:

{
    "/js/app.js": "/js/app.js",
    "/css/app.css": "/css/app.css"
}

Solution

  • I replaced <link rel="stylesheet" href="{{ mix('css/app.css') }}">

    with

    <link rel="stylesheet" href="/css/app.css/">

    and it works now.