area17 / twill

Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/cnWk7EFv8R.
https://twillcms.com
Apache License 2.0
3.75k stars 572 forks source link

Admin route returns 500 error after composer update #2574

Closed shabaz-ejaz closed 4 months ago

shabaz-ejaz commented 5 months ago

Description

After doing a composer update, all of a sudden my admin route returns a 500 error.

in my .ENV I have set ADMIN_APP_PATH=admin

Steps to reproduce

When i go to /admin it redirects me to /admin/login and returns a 500 error.

Expected result

Should just take me to the admin login area.

Actual result

500 error and redirects to /admin/login

I did a composer update and since then this has started to happen. The front end works fine and all my pages work normally except anything in the admin area.

In my laravel.log i see the following:

[2024-04-24 16:19:48] production.ERROR: Uncaught Exception: Twill assets manifest is missing. Make sure you published/updated Twill assets using the "php artisan twill:update" command. in /home/user/public_html/vendor/area17/twill/src/Services/Assets/Twill.php:76
Stack trace:
#0 /home/user/public_html/vendor/area17/twill/src/Services/Assets/Twill.php(18): A17\Twill\Services\Assets\Twill->readManifest()
#1 /home/user/public_html/vendor/area17/twill/src/Services/Assets/Twill.php(13): A17\Twill\Services\Assets\Twill->twillAsset('Inter-Regular.w...')
#2 /home/user/public_html/vendor/area17/twill/src/Helpers/frontend_helpers.php(40): A17\Twill\Services\Assets\Twill->asset('Inter-Regular.w...')
#3 /home/user/public_html/storage/framework/views/8ba0e21ffec163eb2c284b4cdafdef856c75bb71.php(10): twillAsset('Inter-Regular.w...')
#4 /home/user/public_html/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(41): include('/home/user...')
#5 /home/user/public_ {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Uncaught Exception: Twill assets manifest is missing. Make sure you published/updated Twill assets using the \"php artisan twill:update\" command. in /home/user/public_html/vendor/area17/twill/src/Services/Assets/Twill.php:76
Stack trace:

I tried running php artisan twill:update and it runs fine but I still have the same issue. I also ran php artisan twill:build which ran successfully and I still have the same issue.

Versions

Twill version: area17/twill": "^2.0", Laravel version: 7.0 PHP version: PHP 7.2.34 Database engine: InnoDB and MyISAM - MySQL - 5.7.44 OS: CentOS v7.9.2009 STANDARD kvm

ifox commented 5 months ago

Hi @shabaz-ejaz, please try to clear all Laravel caches: php artisan optimize:clear.

Which Twill 2 minor version were you on before running composer update?

shabaz-ejaz commented 5 months ago

Hi @ifox, I tried that and I still get the same error. My previous version of Twill was: "area17/twill": "^2.0",

More specifically from my composer.lock file:

"name": "area17/twill",
            "version": "2.0.1",
            "source": {
                "type": "git",
                "url": "https://github.com/area17/twill.git",
                "reference": "4e19670cb62b9baeb37354c3998ce05add97328c"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/area17/twill/zipball/4e19670cb62b9baeb37354c3998ce05add97328c",
                "reference": "4e19670cb62b9baeb37354c3998ce05add97328c",
                "shasum": ""
            },

Here is the full contents of my previous composer.json file:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5",
        "area17/twill": "^2.0",
        "biscolab/laravel-recaptcha": "^4.1",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^1.0",
        "guzzlehttp/guzzle": "^6.3",
        "kalnoy/nestedset": "^5.0",
        "laravel/framework": "^7.0",
        "laravel/tinker": "^2.0",
        "monarobase/country-list": "^3.1",
        "spatie/laravel-sitemap": "^5.7",
      "ext-json": "*"
    },
    "require-dev": {
        "facade/ignition": "^2.0",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^4.1",
        "phpunit/phpunit": "^8.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}
ifox commented 5 months ago

Did you reload php-fpm? Asking because I see that your logs are production logs.

Do you see the manifest file under public/twill?

shabaz-ejaz commented 5 months ago

Yes I did restart fpm, restarted the server and still get the same error.

I see a file called mix-manifest.json under public, however I don't see any twill folder under public.

The contents of mix-manifest.json are:

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