Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255 #10481

Closed
Ifriqiya opened this issue Jan 23, 2022 · 42 comments

Comments

@Ifriqiya
Copy link

My composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.3|^8.0",
        "enlightn/enlightn": "^1.18",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "inertiajs/inertia-laravel": "^0.3.5",
        "lab404/laravel-impersonate": "^1.7",
        "laravel-notification-channels/pusher-push-notifications": "^2.3",
        "laravel/framework": "8.37",
        "laravel/nexmo-notification-channel": "^2.5",
        "laravel/sanctum": "^2.6",
        "laravel/tinker": "^2.5",
        "propaganistas/laravel-phone": "^4.3",
        "pusher/pusher-php-server": "^6.1",
        "spatie/laravel-disable-floc": "^1.0",
        "tightenco/ziggy": "^1.0",
        "twilio/sdk": "6.24.0",
        "vonage/client": "^2.4",
        "wildbit/swiftmailer-postmark": "^3.3"
    },
    "require-dev": {
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.9.1",
        "laravel/breeze": "^1.1",
        "laravel/sail": "^1.0.1",
        "laravel/telescope": "^4.5",
        "mockery/mockery": "^1.4.2",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": [
                "laravel/telescope"
            ]
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "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"
        ],
        "post-update-cmd": [
            "@php artisan telescope:publish --ansi"
        ]
    }
}

Output of composer diagnose:

Checking composer.json: WARNING
require.laravel/framework : exact version constraints (8.37) should be avoided if the package follows semantic versioning
require.twilio/sdk : exact version constraints (6.24.0) should be avoided if the package follows semantic versioning
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.2.5
PHP version: 8.1.1
OpenSSL version: OpenSSL 1.1.1l  24 Aug 2021
cURL version: 7.77.0 libz 1.2.11 ssl OpenSSL/1.1.1l
zip: extension present, unzip not available, 7-Zip present (7z)

When I run this command:

composer update

I get the following output:


Loading composer repositories with package information
Updating dependencies
Lock file operations: 3 installs, 96 updates, 4 removals
  - Removing laminas/laminas-zendframework-bridge (1.2.0)
  - Removing spatie/laravel-personal-data-export (1.3.2)
  - Removing spatie/temporary-directory (1.3.0)
  - Removing symfony/http-client-contracts (v2.4.0)
  - Upgrading asm89/stack-cors (v2.0.3 => v2.1.1)
  - Upgrading brick/math (0.9.2 => 0.9.3)
  - Upgrading composer/ca-bundle (1.2.9 => 1.3.1)
  - Upgrading composer/composer (2.0.13 => 2.2.5)
  - Upgrading composer/package-versions-deprecated (1.11.99.2 => 1.11.99.5)
  - Locking composer/pcre (1.0.1)
  - Upgrading composer/semver (3.2.4 => 3.2.7)
  - Upgrading composer/spdx-licenses (1.5.5 => 1.5.6)
  - Upgrading composer/xdebug-handler (1.4.6 => 2.0.4)
  - Upgrading doctrine/inflector (2.0.3 => 2.0.4)
  - Upgrading doctrine/lexer (1.2.1 => 1.2.2)
  - Upgrading dragonmantank/cron-expression (v3.1.0 => v3.3.1)
  - Upgrading facade/flare-client-php (1.8.0 => 1.9.1)
  - Upgrading facade/ignition (2.9.0 => 2.17.4)
  - Upgrading fakerphp/faker (v1.14.1 => v1.17.0)
  - Upgrading filp/whoops (2.12.1 => 2.14.5)
  - Upgrading firebase/php-jwt (v5.4.0 => v5.5.1)
  - Upgrading fruitcake/laravel-cors (v2.0.4 => v2.0.5)
  - Upgrading giggsey/libphonenumber-for-php (8.12.23 => 8.12.41)
  - Upgrading giggsey/locale (1.9 => 2.1)
  - Upgrading graham-campbell/result-type (v1.0.1 => v1.0.4)
  - Upgrading guzzlehttp/guzzle (7.3.0 => 7.4.1)
  - Upgrading guzzlehttp/promises (1.4.1 => 1.5.1)
  - Upgrading guzzlehttp/psr7 (1.8.2 => 2.1.0)
  - Upgrading justinrainbow/json-schema (5.2.10 => 5.2.11)
  - Upgrading lab404/laravel-impersonate (1.7.2 => 1.7.3)
  - Upgrading laminas/laminas-diactoros (2.6.0 => 2.8.0)
  - Upgrading laravel/sail (v1.5.0 => v1.13.1)
  - Upgrading laravel/sanctum (v2.10.0 => v2.14.0)
  - Upgrading laravel/telescope (v4.5.0 => v4.7.0)
  - Upgrading laravel/tinker (v2.6.1 => v2.7.0)
  - Locking lcobucci/clock (2.1.0)
  - Upgrading lcobucci/jwt (3.4.5 => 4.0.4)
  - Upgrading league/commonmark (1.6.0 => 1.6.7)
  - Upgrading league/flysystem (1.1.3 => 1.1.9)
  - Upgrading league/iso3166 (3.0.0 => 4.0.0)
  - Upgrading league/mime-type-detection (1.7.0 => 1.9.0)
  - Upgrading mockery/mockery (1.4.3 => 1.5.0)
  - Upgrading monolog/monolog (2.2.0 => 2.3.5)
  - Upgrading nesbot/carbon (2.47.0 => 2.55.2)
  - Upgrading nikic/php-parser (v4.10.5 => v4.13.2)
  - Upgrading nunomaduro/collision (v5.4.0 => v5.11.0)
  - Upgrading nunomaduro/larastan (v0.7.5 => v0.7.15)
  - Upgrading paragonie/sodium_compat (v1.15.4 => v1.17.0)
  - Upgrading phar-io/manifest (2.0.1 => 2.0.3)
  - Upgrading phpdocumentor/reflection-docblock (5.2.2 => 5.3.0)
  - Upgrading phpdocumentor/type-resolver (1.4.0 => 1.6.0)
  - Upgrading phpoption/phpoption (1.7.5 => 1.8.1)
  - Upgrading phpspec/prophecy (1.13.0 => v1.15.0)
  - Upgrading phpstan/phpstan (0.12.85 => 0.12.99)
  - Upgrading phpunit/php-code-coverage (9.2.6 => 9.2.10)
  - Upgrading phpunit/php-file-iterator (3.0.5 => 3.0.6)
  - Upgrading phpunit/phpunit (9.5.4 => 9.5.12)
  - Upgrading propaganistas/laravel-phone (4.3.0 => 4.3.6)
  - Upgrading psr/container (1.1.1 => 1.1.2)
  - Upgrading psy/psysh (v0.10.8 => v0.11.1)
  - Upgrading ramsey/collection (1.1.3 => 1.2.2)
  - Upgrading ramsey/uuid (4.1.1 => 4.2.3)
  - Upgrading sebastian/exporter (4.0.3 => 4.0.4)
  - Upgrading sebastian/global-state (5.0.2 => 5.0.3)
  - Upgrading sebastian/type (2.3.1 => 2.3.4)
  - Upgrading seld/phar-utils (1.1.1 => 1.2.0)
  - Upgrading spatie/laravel-disable-floc (1.0.0 => 1.0.1)
  - Upgrading swiftmailer/swiftmailer (v6.2.7 => v6.3.0)
  - Upgrading symfony/console (v5.2.7 => v5.4.2)
  - Upgrading symfony/css-selector (v5.2.7 => v6.0.2)
  - Upgrading symfony/deprecation-contracts (v2.4.0 => v3.0.0)
  - Upgrading symfony/error-handler (v5.2.7 => v5.4.2)
  - Upgrading symfony/event-dispatcher (v5.2.4 => v6.0.2)
  - Upgrading symfony/event-dispatcher-contracts (v2.4.0 => v3.0.0)
  - Upgrading symfony/filesystem (v5.2.7 => v6.0.0)
  - Upgrading symfony/finder (v5.2.4 => v5.4.2)
  - Upgrading symfony/http-foundation (v5.2.7 => v5.4.2)
  - Upgrading symfony/http-kernel (v5.2.7 => v5.4.2)
  - Upgrading symfony/mime (v5.2.7 => v5.4.2)
  - Upgrading symfony/polyfill-ctype (v1.22.1 => v1.24.0)
  - Upgrading symfony/polyfill-iconv (v1.22.1 => v1.24.0)
  - Upgrading symfony/polyfill-intl-grapheme (v1.22.1 => v1.24.0)
  - Upgrading symfony/polyfill-intl-idn (v1.22.1 => v1.24.0)
  - Upgrading symfony/polyfill-intl-normalizer (v1.22.1 => v1.24.0)
  - Upgrading symfony/polyfill-mbstring (v1.22.1 => v1.24.0)
  - Upgrading symfony/polyfill-php72 (v1.22.1 => v1.24.0)
  - Upgrading symfony/polyfill-php73 (v1.22.1 => v1.24.0)
  - Upgrading symfony/polyfill-php80 (v1.22.1 => v1.24.0)
  - Locking symfony/polyfill-php81 (v1.24.0)
  - Upgrading symfony/process (v5.2.7 => v5.4.2)
  - Upgrading symfony/routing (v5.2.7 => v5.4.0)
  - Upgrading symfony/service-contracts (v2.4.0 => v2.4.1)
  - Upgrading symfony/string (v5.2.6 => v6.0.2)
  - Upgrading symfony/translation (v5.2.7 => v6.0.2)
  - Upgrading symfony/translation-contracts (v2.4.0 => v3.0.0)
  - Upgrading symfony/var-dumper (v5.2.7 => v5.4.2)
  - Upgrading symfony/yaml (v5.2.7 => v5.4.2)
  - Upgrading theseer/tokenizer (1.2.0 => 1.2.1)
  - Upgrading tightenco/ziggy (v1.1.0 => v1.4.2)
  - Upgrading tijsverkoyen/css-to-inline-styles (2.2.3 => 2.2.4)
  - Upgrading vlucas/phpdotenv (v5.3.0 => v5.4.1)
  - Upgrading vonage/client-core (2.9.2 => 2.10.0)
  - Upgrading vonage/nexmo-bridge (0.1.0 => 0.1.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 96 updates, 4 removals
  - Downloading composer/package-versions-deprecated (1.11.99.5)
  - Downloading composer/ca-bundle (1.3.1)
  - Downloading composer/semver (3.2.7)
  - Downloading composer/spdx-licenses (1.5.6)
  - Downloading composer/pcre (1.0.1)
  - Downloading composer/xdebug-handler (2.0.4)
  - Downloading phpstan/phpstan (0.12.99)
  - Downloading league/commonmark (1.6.7)
  - Downloading symfony/filesystem (v6.0.0)
  - Downloading seld/phar-utils (1.2.0)
  - Downloading composer/composer (2.2.5)
  - Downloading nunomaduro/larastan (v0.7.15)
  - Downloading symfony/yaml (v5.4.2)
  - Downloading lab404/laravel-impersonate (1.7.3)
  - Downloading firebase/php-jwt (v5.5.1)
  - Downloading vonage/nexmo-bridge (0.1.1)
  - Downloading lcobucci/clock (2.1.0)
  - Downloading lcobucci/jwt (4.0.4)
  - Downloading vonage/client-core (2.10.0)
  - Downloading phpunit/phpunit (9.5.12)
  - Downloading giggsey/libphonenumber-for-php (8.12.41)
  - Downloading propaganistas/laravel-phone (4.3.6)
  - Removing symfony/http-client-contracts (v2.4.0)
  - Removing spatie/temporary-directory (1.3.0)
  - Removing spatie/laravel-personal-data-export (1.3.2)
  - Removing laminas/laminas-zendframework-bridge (1.2.0)
  - Upgrading composer/package-versions-deprecated (1.11.99.2 => 1.11.99.5): Extracting archive
  - Upgrading composer/ca-bundle (1.2.9 => 1.3.1): Extracting archive
  - Upgrading composer/semver (3.2.4 => 3.2.7): Extracting archive
  - Upgrading composer/spdx-licenses (1.5.5 => 1.5.6): Extracting archive
  - Installing composer/pcre (1.0.1): Extracting archive
  - Upgrading composer/xdebug-handler (1.4.6 => 2.0.4): Extracting archive
  - Upgrading doctrine/inflector (2.0.3 => 2.0.4): Extracting archive
  - Upgrading symfony/polyfill-ctype (v1.22.1 => v1.24.0): Extracting archive
  - Upgrading dragonmantank/cron-expression (v3.1.0 => v3.3.1): Extracting archive
  - Upgrading symfony/polyfill-php72 (v1.22.1 => v1.24.0): Extracting archive
  - Upgrading symfony/polyfill-intl-normalizer (v1.22.1 => v1.24.0): Extracting archive
  - Upgrading symfony/polyfill-intl-idn (v1.22.1 => v1.24.0): Extracting archive
  - Upgrading doctrine/lexer (1.2.1 => 1.2.2): Extracting archive
  - Upgrading symfony/polyfill-php80 (v1.22.1 => v1.24.0): Extracting archive
  - Upgrading symfony/deprecation-contracts (v2.4.0 => v3.0.0): Extracting archive
  - Upgrading symfony/finder (v5.2.4 => v5.4.2): Extracting archive
  - Upgrading phpstan/phpstan (0.12.85 => 0.12.99): Extracting archive
  - Upgrading symfony/process (v5.2.7 => v5.4.2): Extracting archive
  - Upgrading mockery/mockery (1.4.3 => 1.5.0): Extracting archive
  - Upgrading symfony/polyfill-mbstring (v1.22.1 => v1.24.0): Extracting archive
  - Upgrading phpoption/phpoption (1.7.5 => 1.8.1): Extracting archive
  - Upgrading graham-campbell/result-type (v1.0.1 => v1.0.4): Extracting archive
  - Upgrading vlucas/phpdotenv (v5.3.0 => v5.4.1): Extracting archive
  - Upgrading symfony/css-selector (v5.2.7 => v6.0.2): Extracting archive
  - Upgrading tijsverkoyen/css-to-inline-styles (2.2.3 => 2.2.4): Extracting archive
  - Upgrading symfony/var-dumper (v5.2.7 => v5.4.2): Extracting archive
  - Upgrading symfony/routing (v5.2.7 => v5.4.0): Extracting archive
  - Upgrading symfony/mime (v5.2.7 => v5.4.2): Extracting archive
  - Upgrading symfony/polyfill-php73 (v1.22.1 => v1.24.0): Extracting archive
  - Upgrading symfony/http-foundation (v5.2.7 => v5.4.2): Extracting archive
  - Upgrading symfony/event-dispatcher-contracts (v2.4.0 => v3.0.0): Extracting archive
  - Upgrading symfony/event-dispatcher (v5.2.4 => v6.0.2): Extracting archive
  - Upgrading symfony/error-handler (v5.2.7 => v5.4.2): Extracting archive
  - Upgrading symfony/http-kernel (v5.2.7 => v5.4.2): Extracting archive
  - Upgrading symfony/polyfill-intl-grapheme (v1.22.1 => v1.24.0): Extracting archive
  - Upgrading symfony/string (v5.2.6 => v6.0.2): Extracting archive
  - Upgrading psr/container (1.1.1 => 1.1.2): Extracting archive
  - Upgrading symfony/service-contracts (v2.4.0 => v2.4.1): Extracting archive
  - Upgrading symfony/console (v5.2.7 => v5.4.2): Extracting archive
  - Upgrading symfony/polyfill-iconv (v1.22.1 => v1.24.0): Extracting archive
  - Upgrading swiftmailer/swiftmailer (v6.2.7 => v6.3.0): Extracting archive
  - Installing symfony/polyfill-php81 (v1.24.0): Extracting archive
  - Upgrading ramsey/collection (1.1.3 => 1.2.2): Extracting archive
  - Upgrading brick/math (0.9.2 => 0.9.3): Extracting archive
  - Upgrading ramsey/uuid (4.1.1 => 4.2.3): Extracting archive
  - Upgrading symfony/translation-contracts (v2.4.0 => v3.0.0): Extracting archive
  - Upgrading symfony/translation (v5.2.7 => v6.0.2): Extracting archive
  - Upgrading nesbot/carbon (2.47.0 => 2.55.2): Extracting archive
  - Upgrading monolog/monolog (2.2.0 => 2.3.5): Extracting archive
  - Upgrading league/mime-type-detection (1.7.0 => 1.9.0): Extracting archive
  - Upgrading league/flysystem (1.1.3 => 1.1.9): Extracting archive
  - Upgrading league/commonmark (1.6.0 => 1.6.7): Extracting archive
  - Upgrading symfony/filesystem (v5.2.7 => v6.0.0): Extracting archive
  - Upgrading seld/phar-utils (1.1.1 => 1.2.0): Extracting archive
  - Upgrading justinrainbow/json-schema (5.2.10 => 5.2.11): Extracting archive
  - Upgrading composer/composer (2.0.13 => 2.2.5): Extracting archive
  - Upgrading nunomaduro/larastan (v0.7.5 => v0.7.15): Extracting archive
  - Upgrading nikic/php-parser (v4.10.5 => v4.13.2): Extracting archive
  - Upgrading guzzlehttp/psr7 (1.8.2 => 2.1.0): Extracting archive
  - Upgrading guzzlehttp/promises (1.4.1 => 1.5.1): Extracting archive
  - Upgrading guzzlehttp/guzzle (7.3.0 => 7.4.1): Extracting archive
  - Upgrading symfony/yaml (v5.2.7 => v5.4.2): Extracting archive
  - Upgrading facade/flare-client-php (1.8.0 => 1.9.1): Extracting archive
  - Upgrading facade/ignition (2.9.0 => 2.17.4): Extracting archive
  - Upgrading fakerphp/faker (v1.14.1 => v1.17.0): Extracting archive
  - Upgrading asm89/stack-cors (v2.0.3 => v2.1.1): Extracting archive
  - Upgrading fruitcake/laravel-cors (v2.0.4 => v2.0.5): Extracting archive
  - Upgrading giggsey/locale (1.9 => 2.1): Extracting archive
  - Upgrading lab404/laravel-impersonate (1.7.2 => 1.7.3): Extracting archive
  - Upgrading firebase/php-jwt (v5.4.0 => v5.5.1): Extracting archive
  - Upgrading vonage/nexmo-bridge (0.1.0 => 0.1.1): Extracting archive
  - Installing lcobucci/clock (2.1.0): Extracting archive
  - Upgrading lcobucci/jwt (3.4.5 => 4.0.4): Extracting archive
  - Upgrading laminas/laminas-diactoros (2.6.0 => 2.8.0): Extracting archive
  - Upgrading vonage/client-core (2.9.2 => 2.10.0): Extracting archive
  - Upgrading laravel/sail (v1.5.0 => v1.13.1): Extracting archive
  - Upgrading laravel/sanctum (v2.10.0 => v2.14.0): Extracting archive
  - Upgrading laravel/telescope (v4.5.0 => v4.7.0): Extracting archive
  - Upgrading psy/psysh (v0.10.8 => v0.11.1): Extracting archive
  - Upgrading laravel/tinker (v2.6.1 => v2.7.0): Extracting archive
  - Upgrading filp/whoops (2.12.1 => 2.14.5): Extracting archive
  - Upgrading nunomaduro/collision (v5.4.0 => v5.11.0): Extracting archive
  - Upgrading phpdocumentor/type-resolver (1.4.0 => 1.6.0): Extracting archive
  - Upgrading phpdocumentor/reflection-docblock (5.2.2 => 5.3.0): Extracting archive
  - Upgrading sebastian/type (2.3.1 => 2.3.4): Extracting archive
  - Upgrading sebastian/global-state (5.0.2 => 5.0.3): Extracting archive
  - Upgrading sebastian/exporter (4.0.3 => 4.0.4): Extracting archive
  - Upgrading phpunit/php-file-iterator (3.0.5 => 3.0.6): Extracting archive
  - Upgrading theseer/tokenizer (1.2.0 => 1.2.1): Extracting archive
  - Upgrading phpunit/php-code-coverage (9.2.6 => 9.2.10): Extracting archive
  - Upgrading phpspec/prophecy (1.13.0 => v1.15.0): Extracting archive
  - Upgrading phar-io/manifest (2.0.1 => 2.0.3): Extracting archive
  - Upgrading phpunit/phpunit (9.5.4 => 9.5.12): Extracting archive
  - Upgrading league/iso3166 (3.0.0 => 4.0.0): Extracting archive
  - Upgrading giggsey/libphonenumber-for-php (8.12.23 => 8.12.41): Extracting archive
  - Upgrading propaganistas/laravel-phone (4.3.0 => 4.3.6): Extracting archive
  - Upgrading paragonie/sodium_compat (v1.15.4 => v1.17.0): Extracting archive
  - Upgrading spatie/laravel-disable-floc (1.0.0 => 1.0.1): Extracting archive
  - Upgrading tightenco/ziggy (v1.1.0 => v1.4.2): Extracting archive
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Generating optimized autoload files
Deprecation Notice: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:251
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
Deprecation Notice: Return type of Illuminate\Container\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Container\Container.php:1352
Deprecation Notice: Return type of Illuminate\Container\Container::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Container\Container.php:1363
Deprecation Notice: Return type of Illuminate\Container\Container::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Container\Container.php:1375
Deprecation Notice: Return type of Illuminate\Container\Container::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Container\Container.php:1388
> @php artisan package:discover --ansi
PHP Fatal error:  During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice 
in C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Collections\Collection.php:1411
Stack trace:
#0 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Collections\Collection.php(11): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Return type of ...', 'C:\\xampp\\htdocs...', 1411)
#1 C:\xampp\htdocs\spa\vendor\composer\ClassLoader.php(480): include('C:\\xampp\\htdocs...')
#2 C:\xampp\htdocs\spa\vendor\composer\ClassLoader.php(346): Composer\Autoload\includeFile('C:\\xampp\\htdocs...')
#3 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Collections\helpers.php(15): Composer\Autoload\ClassLoader->loadClass('Illuminate\\Supp...')   
#4 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(130): collect(Array)
#5 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(106): Illuminate\Foundation\PackageManifest->build()
#6 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(89): Illuminate\Foundation\PackageManifest->getManifest()       
#7 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(78): Illuminate\Foundation\PackageManifest->config('aliases')   
#8 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\RegisterFacades.php(26): Illuminate\Foundation\PackageManifest->aliases() 
#9 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(237): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap(Object(Illuminate\Foundation\Application))
#10 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(310): Illuminate\Foundation\Application->bootstrapWith(Array)   
#11 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(127): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 C:\xampp\htdocs\spa\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main} in C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Collections\Collection.php on line 11
PHP Fatal error:  Uncaught Error: Class "Illuminate\Support\Collection" not found in C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Collections\helpers.php:15
Stack trace:
#0 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Support\Traits\ReflectsClosures.php(24): collect(Array)
#1 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Support\Traits\ReflectsClosures.php(43): Illuminate\Foundation\Exceptions\ReportableHandler->closureParameterTypes(Object(Closure))
#2 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\ReportableHandler.php(62): Illuminate\Foundation\Exceptions\ReportableHandler->firstClosureParameterType(Object(Closure))
#3 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(232): Illuminate\Foundation\Exceptions\ReportableHandler->handles(Object(Symfony\Component\ErrorHandler\Error\FatalError))
#4 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(88): Illuminate\Foundation\Exceptions\Handler->report(Object(Symfony\Component\ErrorHandler\Error\FatalError))
#5 C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(130): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\ErrorHandler\Error\FatalError))
#6 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#7 {main}
  thrown in C:\xampp\htdocs\spa\vendor\laravel\framework\src\Illuminate\Collections\helpers.php on line 15
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

And I expected this to happen:
Generate optimised files and complete step, but instead, I can't run any artisan command.

@Ifriqiya
Copy link
Author

Dealing with the warnings from composer diagnose command resolved this issue for me.

@Ifriqiya
Copy link
Author

I again encountered this issue on another project I was trying to update.

My 'composer diagnose' command gave an all clear output:

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.2.5
PHP version: 8.1.1
OpenSSL version: OpenSSL 1.1.1l  24 Aug 2021
cURL version: 7.77.0 libz 1.2.11 ssl OpenSSL/1.1.1l
zip: extension present, unzip not available, 7-Zip present (7z)

Composer update gave the following output:

Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

Fatal error: Declaration of App\Exceptions\Handler::report(Exception $exception) must be compatible with Illuminate\Foundation\Exceptions\Handler::report(Throwable $e) in C:\xampp\htdocs\smartwealthng\app\Exceptions\Handler.php on line 37
PHP Fatal error:  Declaration of App\Exceptions\Handler::report(Exception $exception) must be compatible with Illuminate\Foundation\Exceptions\Handler::report(Throwable $e) in C:\xampp\htdocs\smartwealthng\app\Exceptions\Handler.php on line 37
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

@Ifriqiya Ifriqiya reopened this Jan 24, 2022
@Ifriqiya
Copy link
Author

I'm such an idiot! The problem was starring me right in the face...

@VanDeHoop
Copy link

Hi, I solved the problem following the laravel upgrade guide in https://laravel.com/docs/7.x/upgrade#symfony-5-related-upgrades.

Laravel 7 utilizes the 5.x series of the Symfony components. Some minor changes to your application are required to accommodate this upgrade.

Foremost a change of Exception to Throwable in my app/Exceptions/Handler.php

@auliaaljihad
Copy link

i have same problem. can you help me how to fix this problem? thanks

@Evaristo-Paulo
Copy link

I'm facing the same problem. I cannot run any php artisan command.

How did you guys fix it?

@repozituar
Copy link

I'm facing the same problem. I cannot run any php artisan command.

How did you guys fix it?

If you still have not solved the issue then please copy paste the error here.

@boyfinstar
Copy link

I'm such an idiot! The problem was staring me right in the face...

Please what was the issue and how did you solve it? I seem to be having the same issue.

@gusvnadyke
Copy link

bruh

I'm such an idiot! The problem was starring me right in the face...

@being-yash
Copy link

bruh

I'm such an idiot! The problem was starring me right in the face...

I'm also getting same error while running composer install/update please lemme know how can i solve my error

@prodkt
Copy link

prodkt commented Aug 28, 2022

Getting this too all of a sudden! Anyone have an answer yet?

@brightraudona
Copy link

i'm getting this too @Ifriqiya

@Ifriqiya
Copy link
Author

Ifriqiya commented Sep 7, 2022

@boyfinstar @brightraudona @being-yash @prodkt What error(s) message(s) are you getting? Mine had to do with updating my exceptions handler.php file to use the Throwable interface. Running 'composer diagnose' might throw some light.

@farirai123
Copy link

@php artisan package:discover --ansi

In Collection.php line 11:

During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be c
ompatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress
the notice in C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\Collection.php
:1277
Stack trace:
#0 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\Collection.php(11): Illumi
nate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\composer\ClassLoader.php(571): include('...')
#2 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile()
#3 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\helpers.php(109): Composer
\Autoload\ClassLoader->loadClass()
#4 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(130
): collect()
#5 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(106
): Illuminate\Foundation\PackageManifest->build()
#6 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(89)
: Illuminate\Foundation\PackageManifest->getManifest()
#7 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(78)
: Illuminate\Foundation\PackageManifest->config()
#8 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\RegisterFacad
es.php(26): Illuminate\Foundation\PackageManifest->aliases()
#9 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(219): I
lluminate\Foundation\Bootstrap\RegisterFacades->bootstrap()
#10 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(320
): Illuminate\Foundation\Application->bootstrapWith()
#11 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(129
): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#13 {main}

PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\Collection.php:1277
Stack trace:
#0 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\Collection.php(11): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\composer\ClassLoader.php(571): include('...')
#2 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile()
#3 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\helpers.php(109): Composer\Autoload\ClassLoader->loadClass()
#4 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(130): collect()
#5 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(106): Illuminate\Foundation\PackageManifest->build()
#6 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(89): Illuminate\Foundation\PackageManifest->getManifest()
#7 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(78): Illuminate\Foundation\PackageManifest->config()
#8 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\RegisterFacades.php(26): Illuminate\Foundation\PackageManifest->aliases()
#9 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(219): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap()
#10 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(320): Illuminate\Foundation\Application->bootstrapWith()
#11 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(129): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#13 {main} in C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\Collection.php on line 11
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
PS C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master>

@farirai123
Copy link

tried running composer update but got the error below

@php artisan package:discover --ansi

In Collection.php line 11:

During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be c
ompatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress
the notice in C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\Collection.php
:1277
Stack trace:
#0 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\Collection.php(11): Illumi
nate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\composer\ClassLoader.php(571): include('...')
#2 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile()
#3 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\helpers.php(109): Composer
\Autoload\ClassLoader->loadClass()
#4 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(130
): collect()
#5 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(106
): Illuminate\Foundation\PackageManifest->build()
#6 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(89)
: Illuminate\Foundation\PackageManifest->getManifest()
#7 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(78)
: Illuminate\Foundation\PackageManifest->config()
#8 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\RegisterFacad
es.php(26): Illuminate\Foundation\PackageManifest->aliases()
#9 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(219): I
lluminate\Foundation\Bootstrap\RegisterFacades->bootstrap()
#10 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(320
): Illuminate\Foundation\Application->bootstrapWith()
#11 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(129
): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#13 {main}

PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\Collection.php:1277
Stack trace:
#0 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\Collection.php(11): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\composer\ClassLoader.php(571): include('...')
#2 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile()
#3 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\helpers.php(109): Composer\Autoload\ClassLoader->loadClass()
#4 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(130): collect()
#5 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(106): Illuminate\Foundation\PackageManifest->build()
#6 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(89): Illuminate\Foundation\PackageManifest->getManifest()
#7 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(78): Illuminate\Foundation\PackageManifest->config()
#8 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\RegisterFacades.php(26): Illuminate\Foundation\PackageManifest->aliases()
#9 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(219): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap()
#10 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(320): Illuminate\Foundation\Application->bootstrapWith()
#11 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(129): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#13 {main} in C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master\vendor\laravel\framework\src\Illuminate\Support\Collection.php on line 11
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
PS C:\Users\FARIRAI\Desktop\Laravel-Adminator-QuickAdminPanel-master>

@Srushti-353
Copy link

I got the following error while updating the composer in xampp/htdocs folder. I have tried all the methods but nothing actually works. I urgently need help with this.

Fatal error: Uncaught ReflectionException: Class App\Console\Kernel does not exist in C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php:803
Stack trace:
#0 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php(803): ReflectionClass->__construct('App\Console\Ker...')
#1 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php(681): Illuminate\Container\Container->build('App\Console\Ker...')
#2 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(785): Illuminate\Container\Container->resolve('App\Console\Ker...', Array, false)
#3 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php(265): Illuminate\Foundation\Application->resolve('App\Console\Ker...', Array, false)
#4 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php(799): Illuminate\Container\Container->Illuminate\Container{closure}(Object(Illuminate\Foundation\Application), Array)
#5 C:\xampp\htdocs\ in C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 805
PHP Fatal error: Uncaught ReflectionException: Class App\Console\Kernel does not exist in C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php:803
Stack trace:
#0 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php(803): ReflectionClass->__construct('App\Console\Ker...')
#1 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php(681): Illuminate\Container\Container->build('App\Console\Ker...')
#2 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(785): Illuminate\Container\Container->resolve('App\Console\Ker...', Array, false)
#3 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php(265): Illuminate\Foundation\Application->resolve('App\Console\Ker...', Array, false)
#4 C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php(799): Illuminate\Container\Container->Illuminate\Container{closure}(Object(Illuminate\Foundation\Application), Array)
#5 C:\xampp\htdocs\ in C:\xampp\htdocs\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 805
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

@being-yash
Copy link

if u're working with an existing prooject try running
composer update

@farirai123
Copy link

farirai123 commented Sep 26, 2022 via email

@deepaksharma-507
Copy link

I'm such an idiot! The problem was starring me right in the face...

And... what was it ??? I am in a same boat and this is driving me crazy.

@Ifriqiya
Copy link
Author

Ifriqiya commented Oct 8, 2022

@deepaksharma-507, What error(s) message(s) are you getting? Mine had to do with updating my exceptions handler.php file to use the Throwable interface. Running 'composer diagnose' might throw some light.

@Alukkee98
Copy link

Some one know what can i run the command composer or php artisan?? return me erating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump
Script Illuminate\Foundation\ComposerScripts::postAutoloadDump handling the post-autoload-dump event terminated with an exception

In bootstrap.php line 19:

require(C:\NASA\xampp\htdocs\Easy-School\vendor\symfony\polyfill-intl-idn/bootstrap80.php): Failed to open stream: No such file or directory

@deepaksharma-507
Copy link

@Alukkee98 You might be missing a package polyfill-intl-idn. For any detailed error messages check your PHP log file.

@deepaksharma-507
Copy link

@deepaksharma-507, What error(s) message(s) are you getting? Mine had to do with updating my exceptions handler.php file to use the Throwable interface. Running 'composer diagnose' might throw some light.

Sorry for late reply. Just like you mentioned the error was right in my face. I had few old versioned packages, upgrading them resolved my issue.

@ghost
Copy link

ghost commented Dec 8, 2022

i am facing the same issue here

when i run composer update i get the message below

Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 2 installs, 73 updates, 6 removals

  • Removing phpdocumentor/reflection-common (2.2.0)
  • Removing phpdocumentor/reflection-docblock (5.2.2)
  • Removing phpdocumentor/type-resolver (1.4.0)
  • Removing phpspec/prophecy (1.13.0)
  • Removing symfony/http-client-contracts (v2.4.0)
  • Removing webmozart/assert (1.10.0)
  • Upgrading asm89/stack-cors (v2.0.3 => v2.1.1)
  • Upgrading brick/math (0.9.2 => 0.10.2)
  • Upgrading doctrine/inflector (2.0.3 => 2.0.6)
  • Upgrading doctrine/instantiator (1.4.0 => 1.4.1)
  • Upgrading doctrine/lexer (1.2.1 => 1.2.3)
  • Upgrading facade/flare-client-php (1.8.1 => 1.10.0)
  • Upgrading facade/ignition (2.9.0 => 2.17.6)
  • Upgrading fakerphp/faker (v1.14.1 => v1.20.0)
  • Upgrading fideloper/proxy (4.4.1 => 4.4.2)
  • Upgrading filp/whoops (2.12.1 => 2.14.6)
  • Upgrading fruitcake/laravel-cors (v2.0.4 => v2.2.0)
  • Upgrading guzzlehttp/guzzle (7.3.0 => 7.5.0)
  • Upgrading guzzlehttp/promises (1.4.1 => 1.5.2)
  • Upgrading guzzlehttp/psr7 (1.8.2 => 2.4.3)
  • Upgrading laravel/framework (v7.30.4 => v7.30.6)
  • Upgrading laravel/tinker (v2.6.1 => v2.7.3)
  • Upgrading league/commonmark (1.6.2 => 1.6.7)
  • Upgrading league/flysystem (1.1.3 => 1.1.10)
  • Upgrading league/mime-type-detection (1.7.0 => 1.11.0)
  • Upgrading mockery/mockery (1.4.3 => 1.5.1)
  • Upgrading monolog/monolog (2.2.0 => 2.8.0)
  • Upgrading myclabs/deep-copy (1.10.2 => 1.11.0)
  • Upgrading nesbot/carbon (2.48.1 => 2.64.0)
  • Upgrading nikic/php-parser (v4.10.5 => v4.15.2)
  • Upgrading opis/closure (3.6.2 => 3.6.3)
  • Upgrading phar-io/manifest (2.0.1 => 2.0.3)
  • Upgrading phar-io/version (3.1.0 => 3.2.1)
  • Upgrading phpoption/phpoption (1.7.5 => 1.9.0)
  • Upgrading phpunit/php-code-coverage (9.2.6 => 9.2.19)
  • Upgrading phpunit/php-file-iterator (3.0.5 => 3.0.6)
  • Upgrading phpunit/phpunit (9.5.4 => 9.5.26)
  • Upgrading psr/container (1.1.1 => 1.1.2)
  • Locking psr/http-factory (1.0.1)
  • Upgrading psy/psysh (v0.10.8 => v0.11.9)
  • Upgrading qcod/laravel-settings (1.0.9 => 1.1.1)
  • Upgrading ramsey/collection (1.1.3 => 1.2.2)
  • Upgrading ramsey/uuid (4.1.1 => 4.6.0)
  • Upgrading sebastian/comparator (4.0.6 => 4.0.8)
  • Upgrading sebastian/environment (5.1.3 => 5.1.4)
  • Upgrading sebastian/exporter (4.0.3 => 4.0.5)
  • Upgrading sebastian/global-state (5.0.2 => 5.0.5)
  • Upgrading sebastian/type (2.3.1 => 3.2.0)
  • Upgrading spatie/laravel-permission (4.2.0 => 4.4.3)
  • Upgrading swiftmailer/swiftmailer (v6.2.7 => v6.3.0)
  • Upgrading symfony/console (v5.3.0 => v5.4.16)
  • Upgrading symfony/css-selector (v5.3.0 => v6.2.0)
  • Upgrading symfony/deprecation-contracts (v2.4.0 => v3.2.0)
  • Upgrading symfony/error-handler (v5.3.0 => v5.4.15)
  • Upgrading symfony/event-dispatcher (v5.3.0 => v6.2.0)
  • Upgrading symfony/event-dispatcher-contracts (v2.4.0 => v3.2.0)
  • Upgrading symfony/finder (v5.3.0 => v5.4.11)
  • Upgrading symfony/http-foundation (v5.3.0 => v5.4.16)
  • Upgrading symfony/http-kernel (v5.3.0 => v5.4.16)
  • Upgrading symfony/mime (v5.3.0 => v5.4.16)
  • Upgrading symfony/polyfill-ctype (v1.23.0 => v1.27.0)
  • Upgrading symfony/polyfill-iconv (v1.23.0 => v1.27.0)
  • Upgrading symfony/polyfill-intl-grapheme (v1.23.0 => v1.27.0)
  • Upgrading symfony/polyfill-intl-idn (v1.23.0 => v1.27.0)
  • Upgrading symfony/polyfill-intl-normalizer (v1.23.0 => v1.27.0)
  • Upgrading symfony/polyfill-mbstring (v1.23.0 => v1.27.0)
  • Upgrading symfony/polyfill-php72 (v1.23.0 => v1.27.0)
  • Upgrading symfony/polyfill-php73 (v1.23.0 => v1.27.0)
  • Upgrading symfony/polyfill-php80 (v1.23.0 => v1.27.0)
  • Locking symfony/polyfill-php81 (v1.27.0)
  • Upgrading symfony/process (v5.3.0 => v5.4.11)
  • Upgrading symfony/routing (v5.3.0 => v5.4.15)
  • Upgrading symfony/service-contracts (v2.4.0 => v2.5.2)
  • Upgrading symfony/string (v5.3.0 => v6.2.0)
  • Upgrading symfony/translation (v5.3.0 => v6.2.0)
  • Upgrading symfony/translation-contracts (v2.4.0 => v3.2.0)
  • Upgrading symfony/var-dumper (v5.3.0 => v5.4.14)
  • Upgrading theseer/tokenizer (1.2.0 => 1.2.1)
  • Upgrading tijsverkoyen/css-to-inline-styles (2.2.3 => 2.2.5)
  • Upgrading vlucas/phpdotenv (v4.2.0 => v4.3.0)
  • Upgrading voku/portable-ascii (1.5.6 => 1.6.1)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 103 installs, 0 updates, 0 removals
  • Installing doctrine/inflector (2.0.6): Extracting archive
  • Installing doctrine/lexer (1.2.3): Extracting archive
  • Installing dragonmantank/cron-expression (v2.3.1): Extracting archive
  • Installing symfony/polyfill-php80 (v1.27.0): Extracting archive
  • Installing symfony/polyfill-mbstring (v1.27.0): Extracting archive
  • Installing symfony/var-dumper (v5.4.14): Extracting archive
  • Installing symfony/polyfill-intl-normalizer (v1.27.0): Extracting archive
  • Installing symfony/polyfill-intl-grapheme (v1.27.0): Extracting archive
  • Installing symfony/polyfill-ctype (v1.27.0): Extracting archive
  • Installing symfony/string (v6.2.0): Extracting archive
  • Installing symfony/deprecation-contracts (v3.2.0): Extracting archive
  • Installing psr/container (1.1.2): Extracting archive
  • Installing symfony/service-contracts (v2.5.2): Extracting archive
  • Installing symfony/polyfill-php73 (v1.27.0): Extracting archive
  • Installing symfony/console (v5.4.16): Extracting archive
  • Installing psr/log (1.1.4): Extracting archive
  • Installing monolog/monolog (2.8.0): Extracting archive
  • Installing voku/portable-ascii (1.6.1): Extracting archive
  • Installing phpoption/phpoption (1.9.0): Extracting archive
  • Installing vlucas/phpdotenv (v4.3.0): Extracting archive
  • Installing symfony/css-selector (v6.2.0): Extracting archive
  • Installing tijsverkoyen/css-to-inline-styles (2.2.5): Extracting archive
  • Installing symfony/routing (v5.4.15): Extracting archive
  • Installing symfony/process (v5.4.11): Extracting archive
  • Installing symfony/polyfill-php72 (v1.27.0): Extracting archive
  • Installing symfony/polyfill-intl-idn (v1.27.0): Extracting archive
  • Installing symfony/mime (v5.4.16): Extracting archive
  • Installing symfony/http-foundation (v5.4.16): Extracting archive
  • Installing psr/event-dispatcher (1.0.0): Extracting archive
  • Installing symfony/event-dispatcher-contracts (v3.2.0): Extracting archive
  • Installing symfony/event-dispatcher (v6.2.0): Extracting archive
  • Installing symfony/error-handler (v5.4.15): Extracting archive
  • Installing symfony/http-kernel (v5.4.16): Extracting archive
  • Installing symfony/finder (v5.4.11): Extracting archive
  • Installing symfony/polyfill-iconv (v1.27.0): Extracting archive
  • Installing egulias/email-validator (2.1.25): Extracting archive
  • Installing swiftmailer/swiftmailer (v6.3.0): Extracting archive
  • Installing symfony/polyfill-php81 (v1.27.0): Extracting archive
  • Installing ramsey/collection (1.2.2): Extracting archive
  • Installing brick/math (0.10.2): Extracting archive
  • Installing ramsey/uuid (4.6.0): Extracting archive
  • Installing psr/simple-cache (1.0.1): Extracting archive
  • Installing opis/closure (3.6.3): Extracting archive
  • Installing symfony/translation-contracts (v3.2.0): Extracting archive
  • Installing symfony/translation (v6.2.0): Extracting archive
  • Installing nesbot/carbon (2.64.0): Extracting archive
  • Installing league/mime-type-detection (1.11.0): Extracting archive
  • Installing league/flysystem (1.1.10): Extracting archive
  • Installing league/commonmark (1.6.7): Extracting archive
  • Installing laravel/framework (v7.30.6): Extracting archive
  • Installing facade/ignition-contracts (1.0.2): Extracting archive
  • Installing facade/flare-client-php (1.10.0): Extracting archive
  • Installing facade/ignition (2.17.6): Extracting archive
  • Installing fakerphp/faker (v1.20.0): Extracting archive
  • Installing fideloper/proxy (4.4.2): Extracting archive
  • Installing asm89/stack-cors (v2.1.1): Extracting archive
  • Installing fruitcake/laravel-cors (v2.2.0): Extracting archive
  • Installing guzzlehttp/promises (1.5.2): Extracting archive
  • Installing ralouphie/getallheaders (3.0.3): Extracting archive
  • Installing psr/http-message (1.0.1): Extracting archive
  • Installing psr/http-factory (1.0.1): Extracting archive
  • Installing guzzlehttp/psr7 (2.4.3): Extracting archive
  • Installing nikic/php-parser (v4.15.2): Extracting archive
  • Installing psy/psysh (v0.11.9): Extracting archive
  • Installing laravel/tinker (v2.7.3): Extracting archive
  • Installing laravel/ui (v2.5.0): Extracting archive
  • Installing hamcrest/hamcrest-php (v2.0.1): Extracting archive
  • Installing mockery/mockery (1.5.1): Extracting archive
  • Installing filp/whoops (2.14.6): Extracting archive
  • Installing nunomaduro/collision (v4.3.0): Extracting archive
  • Installing paypal/rest-api-sdk-php (1.14.0): Extracting archive
  • Installing sebastian/version (3.0.2): Extracting archive
  • Installing sebastian/type (3.2.0): Extracting archive
  • Installing sebastian/resource-operations (3.0.3): Extracting archive
  • Installing sebastian/recursion-context (4.0.4): Extracting archive
  • Installing sebastian/object-reflector (2.0.4): Extracting archive
  • Installing sebastian/object-enumerator (4.0.4): Extracting archive
  • Installing sebastian/global-state (5.0.5): Extracting archive
  • Installing sebastian/exporter (4.0.5): Extracting archive
  • Installing sebastian/environment (5.1.4): Extracting archive
  • Installing sebastian/diff (4.0.4): Extracting archive
  • Installing sebastian/comparator (4.0.8): Extracting archive
  • Installing sebastian/code-unit (1.0.8): Extracting archive
  • Installing sebastian/cli-parser (1.0.1): Extracting archive
  • Installing phpunit/php-timer (5.0.3): Extracting archive
  • Installing phpunit/php-text-template (2.0.4): Extracting archive
  • Installing phpunit/php-invoker (3.1.1): Extracting archive
  • Installing phpunit/php-file-iterator (3.0.6): Extracting archive
  • Installing theseer/tokenizer (1.2.1): Extracting archive
  • Installing sebastian/lines-of-code (1.0.3): Extracting archive
  • Installing sebastian/complexity (2.0.2): Extracting archive
  • Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  • Installing phpunit/php-code-coverage (9.2.19): Extracting archive
  • Installing phar-io/version (3.2.1): Extracting archive
  • Installing phar-io/manifest (2.0.3): Extracting archive
  • Installing myclabs/deep-copy (1.11.0): Extracting archive
  • Installing doctrine/instantiator (1.4.1): Extracting archive
  • Installing phpunit/phpunit (9.5.26): Extracting archive
  • Installing psr/http-client (1.0.1): Extracting archive
  • Installing qcod/laravel-settings (1.1.1): Extracting archive
  • Installing spatie/laravel-permission (4.4.3): Extracting archive
  • Installing guzzlehttp/guzzle (7.5.0): Extracting archive
  • Installing srmklive/paypal (2.0.0-beta-3): Extracting archive
    Package paypal/rest-api-sdk-php is abandoned, you should avoid using it. No replacement was suggested.
    Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
    Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump
Deprecation Notice: Return type of Illuminate\Container\Container::offsetExists($key) should either be compatible
with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Container\Container.php:1270
Deprecation Notice: Return type of Illuminate\Container\Container::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Container\Container.php:1281
Deprecation Notice: Return type of Illuminate\Container\Container::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Container\Container.php:1293
Deprecation Notice: Return type of Illuminate\Container\Container::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Container\Container.php:1306
@php artisan package:discover --ansi

In Collection.php line 11:

During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::off
setExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\Re
turnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Projects\g
enie_capital-dev\vendor\laravel\framework\src\Illuminate\Support\Collection.php:1349
Stack trace:
#0 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Support\Collection.php(
11): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Return type of ...', 'C:\xampp\ht
docs...', 1349)
#1 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\composer\ClassLoader.php(571): include('C:\xampp\htdoc
s...')
#2 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\composer\ClassLoader.php(428): Composer\Autoload\include
File('C:\xampp\htdocs...')
#3 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Support\helpers.php(110
): Composer\Autoload\ClassLoader->loadClass('Illuminate\Supp...')
#4 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\PackageManif
est.php(130): collect(Array)
#5 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\PackageManif
est.php(106): Illuminate\Foundation\PackageManifest->build()
#6 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\PackageManif
est.php(89): Illuminate\Foundation\PackageManifest->getManifest()
#7 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\PackageManif
est.php(78): Illuminate\Foundation\PackageManifest->config('aliases')
#8 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\Re
gisterFacades.php(26): Illuminate\Foundation\PackageManifest->aliases()
#9 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\Application.
php(230): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap(Object(Illuminate\Foundation\Application
))
#10 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\Console\Ker
nel.php(310): Illuminate\Foundation\Application->bootstrapWith(Array)
#11 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\Console\Ker
nel.php(127): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 C:\xampp\htdocs\Projects\genie_capital-dev\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Obje
ct(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main}

PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Support\Collection.php:1349
Stack trace:
#0 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Support\Collection.php(11):
Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Return type of ...', 'C:\xampp\htdocs...',
1349)
#1 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\composer\ClassLoader.php(571): include('C:\xampp\htdocs...')
#2 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile('C:\xampp\htdocs...')
#3 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Support\helpers.php(110): Composer\Autoload\ClassLoader->loadClass('Illuminate\Supp...')
#4 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(130): collect(Array)
#5 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(106): Illuminate\Foundation\PackageManifest->build()
#6 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(89): Illuminate\Foundation\PackageManifest->getManifest()
#7 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(78): Illuminate\Foundation\PackageManifest->config('aliases')
#8 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\Registe#9 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(230): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap(Object(Illuminate\Foundation\Application))
#10 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(310): Illuminate\Foundation\Application->bootstrapWith(Array)
#11 C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(127): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 C:\xampp\htdocs\Projects\genie_capital-dev\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main} in C:\xampp\htdocs\Projects\genie_capital-dev\vendor\laravel\framework\src\Illuminate\Support\Collection.php on line 11
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

@SadafShk04
Copy link

I tried running composer update to run a downloaded project and got this error.
I also did composer diagnose
please help

C:\xampp\htdocs\Laravel-Library-Management-system-main>composer update
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 8 installs, 77 updates, 9 removals

  • Removing dnoegel/php-xdg-base-dir (v0.1.1)
  • Removing jakub-onderka/php-console-color (v0.2)
  • Removing jakub-onderka/php-console-highlighter (v0.4)
  • Removing phpdocumentor/reflection-common (2.2.0)
  • Removing phpdocumentor/reflection-docblock (5.2.2)
  • Removing phpdocumentor/type-resolver (1.4.0)
  • Removing phpspec/prophecy (1.12.1)
  • Removing phpunit/php-token-stream (3.1.1)
  • Removing webmozart/assert (1.9.1)
  • Upgrading doctrine/inflector (2.0.3 => 2.0.6)
  • Upgrading doctrine/instantiator (1.4.0 => 1.4.1)
  • Upgrading doctrine/lexer (1.2.1 => 1.2.3)
  • Upgrading egulias/email-validator (2.1.24 => 2.1.25)
  • Upgrading facade/flare-client-php (1.3.7 => 1.10.0)
  • Upgrading facade/ignition (1.16.4 => 1.18.1)
  • Upgrading facade/ignition-contracts (1.0.1 => 1.0.2)
  • Upgrading fakerphp/faker (v1.12.0 => v1.21.0)
  • Upgrading fideloper/proxy (4.4.1 => 4.4.2)
  • Upgrading filp/whoops (2.9.1 => 2.14.6)
  • Upgrading laravel/framework (v6.20.5 => v6.20.44)
  • Upgrading laravel/tinker (v2.5.0 => v2.7.3)
  • Upgrading league/commonmark (1.5.7 => 1.6.7)
  • Upgrading league/flysystem (1.1.3 => 1.1.10)
  • Upgrading league/mime-type-detection (1.5.1 => 1.11.0)
  • Upgrading mockery/mockery (1.3.3 => 1.5.1)
  • Upgrading monolog/monolog (2.1.1 => 2.8.0)
  • Upgrading myclabs/deep-copy (1.10.2 => 1.11.0)
  • Upgrading nesbot/carbon (2.41.5 => 2.64.0)
  • Upgrading nikic/php-parser (v4.10.2 => v4.15.2)
  • Upgrading nunomaduro/collision (v3.1.0 => v3.2.0)
  • Upgrading opis/closure (3.6.1 => 3.6.3)
  • Upgrading paragonie/random_compat (v9.99.99 => v9.99.100)
  • Upgrading phar-io/manifest (1.0.3 => 2.0.3)
  • Upgrading phar-io/version (2.0.1 => 3.2.1)
  • Locking php-parallel-lint/php-console-color (v0.3)
  • Locking php-parallel-lint/php-console-highlighter (v0.5)
  • Upgrading phpoption/phpoption (1.7.5 => 1.9.0)
  • Upgrading phpunit/php-code-coverage (7.0.12 => 9.2.22)
  • Upgrading phpunit/php-file-iterator (2.0.2 => 3.0.6)
  • Locking phpunit/php-invoker (3.1.1)
  • Upgrading phpunit/php-text-template (1.2.1 => 2.0.4)
  • Upgrading phpunit/php-timer (2.1.2 => 5.0.3)
  • Upgrading phpunit/phpunit (8.5.10 => 9.5.27)
  • Upgrading psr/container (1.0.0 => 1.1.2)
  • Upgrading psr/log (1.1.3 => 2.0.0)
  • Upgrading psy/psysh (v0.10.4 => v0.11.9)
  • Upgrading ramsey/uuid (3.9.3 => 3.9.7)
  • Upgrading scrivo/highlight.php (v9.18.1.5 => v9.18.1.10)
  • Locking sebastian/cli-parser (1.0.1)
  • Locking sebastian/code-unit (1.0.8)
  • Upgrading sebastian/code-unit-reverse-lookup (1.0.1 => 2.0.3)
  • Upgrading sebastian/comparator (3.0.2 => 4.0.8)
  • Locking sebastian/complexity (2.0.2)
  • Upgrading sebastian/diff (3.0.2 => 4.0.4)
  • Upgrading sebastian/environment (4.2.3 => 5.1.4)
  • Upgrading sebastian/exporter (3.1.2 => 4.0.5)
  • Upgrading sebastian/global-state (3.0.0 => 5.0.5)
  • Locking sebastian/lines-of-code (1.0.3)
  • Upgrading sebastian/object-enumerator (3.0.3 => 4.0.4)
  • Upgrading sebastian/object-reflector (1.1.1 => 2.0.4)
  • Upgrading sebastian/recursion-context (3.0.0 => 4.0.4)
  • Upgrading sebastian/resource-operations (2.0.1 => 3.0.3)
  • Upgrading sebastian/type (1.1.3 => 3.2.0)
  • Upgrading sebastian/version (2.0.1 => 3.0.2)
  • Upgrading swiftmailer/swiftmailer (v6.2.3 => v6.3.0)
  • Upgrading symfony/console (v4.4.16 => v4.4.49)
  • Upgrading symfony/css-selector (v5.1.8 => v6.2.0)
  • Upgrading symfony/debug (v4.4.16 => v4.4.44)
  • Locking symfony/deprecation-contracts (v3.2.0)
  • Upgrading symfony/error-handler (v4.4.16 => v4.4.44)
  • Upgrading symfony/event-dispatcher (v4.4.16 => v4.4.44)
  • Upgrading symfony/event-dispatcher-contracts (v1.1.9 => v1.1.13)
  • Upgrading symfony/finder (v4.4.16 => v4.4.44)
  • Upgrading symfony/http-client-contracts (v2.3.1 => v2.5.2)
  • Upgrading symfony/http-foundation (v4.4.16 => v4.4.49)
  • Upgrading symfony/http-kernel (v4.4.16 => v4.4.49)
  • Upgrading symfony/mime (v5.1.8 => v5.4.16)
  • Upgrading symfony/polyfill-ctype (v1.20.0 => v1.27.0)
  • Upgrading symfony/polyfill-iconv (v1.20.0 => v1.27.0)
  • Upgrading symfony/polyfill-intl-idn (v1.20.0 => v1.27.0)
  • Upgrading symfony/polyfill-intl-normalizer (v1.20.0 => v1.27.0)
  • Upgrading symfony/polyfill-mbstring (v1.20.0 => v1.27.0)
  • Upgrading symfony/polyfill-php72 (v1.20.0 => v1.27.0)
  • Upgrading symfony/polyfill-php73 (v1.20.0 => v1.27.0)
  • Upgrading symfony/polyfill-php80 (v1.20.0 => v1.27.0)
  • Upgrading symfony/process (v4.4.16 => v4.4.44)
  • Upgrading symfony/routing (v4.4.16 => v4.4.44)
  • Upgrading symfony/service-contracts (v2.2.0 => v2.5.2)
  • Upgrading symfony/translation (v4.4.16 => v4.4.47)
  • Upgrading symfony/translation-contracts (v2.3.0 => v2.5.2)
  • Upgrading symfony/var-dumper (v4.4.16 => v4.4.47)
  • Upgrading theseer/tokenizer (1.2.0 => 1.2.1)
  • Upgrading tijsverkoyen/css-to-inline-styles (2.2.3 => 2.2.5)
  • Upgrading vlucas/phpdotenv (v3.6.7 => v3.6.10)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 88 installs, 0 updates, 0 removals
  • Downloading dragonmantank/cron-expression (v2.3.1)
  • Downloading symfony/var-dumper (v4.4.47)
  • Downloading psr/container (1.1.2)
  • Downloading symfony/service-contracts (v2.5.2)
  • Downloading symfony/polyfill-php73 (v1.27.0)
  • Downloading symfony/console (v4.4.49)
  • Downloading scrivo/highlight.php (v9.18.1.10)
  • Downloading psr/log (2.0.0)
  • Downloading vlucas/phpdotenv (v3.6.10)
  • Downloading symfony/routing (v4.4.44)
  • Downloading symfony/process (v4.4.44)
  • Downloading symfony/mime (v5.4.16)
  • Downloading symfony/http-foundation (v4.4.49)
  • Downloading symfony/http-client-contracts (v2.5.2)
  • Downloading symfony/event-dispatcher-contracts (v1.1.13)
  • Downloading symfony/event-dispatcher (v4.4.44)
  • Downloading symfony/debug (v4.4.44)
  • Downloading symfony/error-handler (v4.4.44)
  • Downloading symfony/http-kernel (v4.4.49)
  • Downloading symfony/finder (v4.4.44)
  • Downloading symfony/polyfill-iconv (v1.27.0)
  • Downloading egulias/email-validator (2.1.25)
  • Downloading swiftmailer/swiftmailer (v6.3.0)
  • Downloading paragonie/random_compat (v9.99.100)
  • Downloading ramsey/uuid (3.9.7)
  • Downloading psr/simple-cache (1.0.1)
  • Downloading opis/closure (3.6.3)
  • Downloading symfony/translation-contracts (v2.5.2)
  • Downloading symfony/translation (v4.4.47)
  • Downloading league/flysystem (1.1.10)
  • Downloading league/commonmark (1.6.7)
  • Downloading laravel/framework (v6.20.44)
  • Downloading facade/ignition-contracts (1.0.2)
  • Downloading facade/flare-client-php (1.10.0)
  • Downloading facade/ignition (1.18.1)
  • Downloading fideloper/proxy (4.4.2)
  • Downloading php-parallel-lint/php-console-color (v0.3)
  • Downloading php-parallel-lint/php-console-highlighter (v0.5)
  • Downloading nunomaduro/collision (v3.2.0)
  • Installing doctrine/inflector (2.0.6): Extracting archive
  • Installing doctrine/lexer (1.2.3): Extracting archive
  • Installing dragonmantank/cron-expression (v2.3.1): Extracting archive
  • Installing symfony/polyfill-php80 (v1.27.0): Extracting archive
  • Installing symfony/polyfill-php72 (v1.27.0): Extracting archive
  • Installing symfony/polyfill-mbstring (v1.27.0): Extracting archive
  • Installing symfony/var-dumper (v4.4.47): Extracting archive
  • Installing symfony/deprecation-contracts (v3.2.0): Extracting archive
  • Installing psr/container (1.1.2): Extracting archive
  • Installing symfony/service-contracts (v2.5.2): Extracting archive
  • Installing symfony/polyfill-php73 (v1.27.0): Extracting archive
  • Installing symfony/console (v4.4.49): Extracting archive
  • Installing scrivo/highlight.php (v9.18.1.10): Extracting archive
  • Installing psr/log (2.0.0): Extracting archive
  • Installing monolog/monolog (2.8.0): Extracting archive
  • Installing symfony/polyfill-ctype (v1.27.0): Extracting archive
  • Installing phpoption/phpoption (1.9.0): Extracting archive
  • Installing vlucas/phpdotenv (v3.6.10): Extracting archive
  • Installing symfony/css-selector (v6.2.0): Extracting archive
  • Installing tijsverkoyen/css-to-inline-styles (2.2.5): Extracting archive
  • Installing symfony/routing (v4.4.44): Extracting archive
  • Installing symfony/process (v4.4.44): Extracting archive
  • Installing symfony/polyfill-intl-normalizer (v1.27.0): Extracting archive
  • Installing symfony/polyfill-intl-idn (v1.27.0): Extracting archive
  • Installing symfony/mime (v5.4.16): Extracting archive
  • Installing symfony/http-foundation (v4.4.49): Extracting archive
  • Installing symfony/http-client-contracts (v2.5.2): Extracting archive
  • Installing symfony/event-dispatcher-contracts (v1.1.13): Extracting archive
  • Installing symfony/event-dispatcher (v4.4.44): Extracting archive
  • Installing symfony/debug (v4.4.44): Extracting archive
  • Installing symfony/error-handler (v4.4.44): Extracting archive
  • Installing symfony/http-kernel (v4.4.49): Extracting archive
  • Installing symfony/finder (v4.4.44): Extracting archive
  • Installing symfony/polyfill-iconv (v1.27.0): Extracting archive
  • Installing egulias/email-validator (2.1.25): Extracting archive
  • Installing swiftmailer/swiftmailer (v6.3.0): Extracting archive
  • Installing paragonie/random_compat (v9.99.100): Extracting archive
  • Installing ramsey/uuid (3.9.7): Extracting archive
  • Installing psr/simple-cache (1.0.1): Extracting archive
  • Installing opis/closure (3.6.3): Extracting archive
  • Installing symfony/translation-contracts (v2.5.2): Extracting archive
  • Installing symfony/translation (v4.4.47): Extracting archive
  • Installing nesbot/carbon (2.64.0): Extracting archive
  • Installing league/mime-type-detection (1.11.0): Extracting archive
  • Installing league/flysystem (1.1.10): Extracting archive
  • Installing league/commonmark (1.6.7): Extracting archive
  • Installing laravel/framework (v6.20.44): Extracting archive
  • Installing filp/whoops (2.14.6): Extracting archive
  • Installing facade/ignition-contracts (1.0.2): Extracting archive
  • Installing facade/flare-client-php (1.10.0): Extracting archive
  • Installing facade/ignition (1.18.1): Extracting archive
  • Installing fakerphp/faker (v1.21.0): Extracting archive
  • Installing fideloper/proxy (4.4.2): Extracting archive
  • Installing nikic/php-parser (v4.15.2): Extracting archive
  • Installing psy/psysh (v0.11.9): Extracting archive
  • Installing laravel/tinker (v2.7.3): Extracting archive
  • Installing hamcrest/hamcrest-php (v2.0.1): Extracting archive
  • Installing mockery/mockery (1.5.1): Extracting archive
  • Installing php-parallel-lint/php-console-color (v0.3): Extracting archive
  • Installing php-parallel-lint/php-console-highlighter (v0.5): Extracting archive
  • Installing nunomaduro/collision (v3.2.0): Extracting archive
  • Installing sebastian/version (3.0.2): Extracting archive
  • Installing sebastian/type (3.2.0): Extracting archive
  • Installing sebastian/resource-operations (3.0.3): Extracting archive
  • Installing sebastian/recursion-context (4.0.4): Extracting archive
  • Installing sebastian/object-reflector (2.0.4): Extracting archive
  • Installing sebastian/object-enumerator (4.0.4): Extracting archive
  • Installing sebastian/global-state (5.0.5): Extracting archive
  • Installing sebastian/exporter (4.0.5): Extracting archive
  • Installing sebastian/environment (5.1.4): Extracting archive
  • Installing sebastian/diff (4.0.4): Extracting archive
  • Installing sebastian/comparator (4.0.8): Extracting archive
  • Installing sebastian/code-unit (1.0.8): Extracting archive
  • Installing sebastian/cli-parser (1.0.1): Extracting archive
  • Installing phpunit/php-timer (5.0.3): Extracting archive
  • Installing phpunit/php-text-template (2.0.4): Extracting archive
  • Installing phpunit/php-invoker (3.1.1): Extracting archive
  • Installing phpunit/php-file-iterator (3.0.6): Extracting archive
  • Installing theseer/tokenizer (1.2.1): Extracting archive
  • Installing sebastian/lines-of-code (1.0.3): Extracting archive
  • Installing sebastian/complexity (2.0.2): Extracting archive
  • Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  • Installing phpunit/php-code-coverage (9.2.22): Extracting archive
  • Installing phar-io/version (3.2.1): Extracting archive
  • Installing phar-io/manifest (2.0.3): Extracting archive
  • Installing myclabs/deep-copy (1.11.0): Extracting archive
  • Installing doctrine/instantiator (1.4.1): Extracting archive
  • Installing phpunit/phpunit (9.5.27): Extracting archive
    1 package suggestions were added by new dependencies, use composer suggest to see details.
    Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
    Package symfony/debug is abandoned, you should avoid using it. Use symfony/error-handler instead.
    Generating optimized autoload files
    Class App\Models\BookCategories located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\BookCategories.php does not comply with psr-4 autoloading standard. Skipping.
    Class App\Models\BookIssue located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\BookIssue.php does not comply with psr-4 autoloading standard. Skipping.
    Class App\Models\BookIssueLog located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\BookIssueLog.php does not comply with psr-4 autoloading standard. Skipping.
    Class App\Models\Books located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\Books.php does not comply with psr-4 autoloading standard. Skipping.
    Class App\Models\Branch located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\Branch.php does not comply with psr-4 autoloading standard. Skipping.
    Class App\Models\Categories located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\Categories.php does not comply with psr-4 autoloading standard. Skipping.
    Class App\Models\Issue located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\Issue.php does not comply with psr-4 autoloading standard. Skipping.
    Class App\Models\IssueLog located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\IssueLog.php does not comply with psr-4 autoloading standard. Skipping.
    Class App\Models\Logs located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\Logs.php does not comply with psr-4 autoloading standard. Skipping.
    Class App\Models\Student located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\Student.php does not comply with psr-4 autoloading standard. Skipping.
    Class App\Models\StudentCategories located in C:/xampp/htdocs/Laravel-Library-Management-system-main/app\models\StudentCategories.php does not comply with psr-4 autoloading standard. Skipping.

Illuminate\Foundation\ComposerScripts::postAutoloadDump
Deprecation Notice: Return type of Illuminate\Container\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Container\Container.php:1231
Deprecation Notice: Return type of Illuminate\Container\Container::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Container\Container.php:1242
Deprecation Notice: Return type of Illuminate\Container\Container::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Container\Container.php:1254
Deprecation Notice: Return type of Illuminate\Container\Container::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Container\Container.php:1267
@php artisan package:discover --ansi
PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Support\Collection.php:1277
Stack trace:
#0 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Support\Collection.php(11): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Return type of ...', 'C:\xampp\htdocs...', 1277)
#1 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\composer\ClassLoader.php(122): include('C:\xampp\htdocs...')
#2 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\composer\ClassLoader.php(443): Composer\Autoload\ClassLoader::Composer\Autoload{closure}('C:\xampp\htdocs...')
#3 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Support\helpers.php(109): Composer\Autoload\ClassLoader->loadClass('Illuminate\Supp...')
#4 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(130): collect(Array)
#5 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(106): Illuminate\Foundation\PackageManifest->build()
#6 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(89): Illuminate\Foundation\PackageManifest->getManifest()
#7 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\PackageManifest.php(78): Illuminate\Foundation\PackageManifest->config('aliases')
#8 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\RegisterFacades.php(26): Illuminate\Foundation\PackageManifest->aliases()
#9 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(219): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap(Object(Illuminate\Foundation\Application))
#10 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(320): Illuminate\Foundation\Application->bootstrapWith(Array)
#11 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(129): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 C:\xampp\htdocs\Laravel-Library-Management-system-main\artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main} in C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Support\Collection.php on line 11

In Collection.php line 11:

During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExi
sts($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWill
Change] attribute should be used to temporarily suppress the notice in C:\xampp\htdocs\Laravel-Library-Management-s
ystem-main\vendor\laravel\framework\src\Illuminate\Support\Collection.php:1277
Stack trace:
#0 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Support\Collectio
n.php(11): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Return type of ...', 'C:\xampp\ht
docs...', 1277)
#1 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\composer\ClassLoader.php(122): include('C:\xampp
\htdocs...')
#2 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\composer\ClassLoader.php(443): Composer\Autoload\C
lassLoader::Composer\Autoload{closure}('C:\xampp\htdocs...')
#3 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Support\helpers.p
hp(109): Composer\Autoload\ClassLoader->loadClass('Illuminate\Supp...')
#4 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Packag
eManifest.php(130): collect(Array)
#5 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Packag
eManifest.php(106): Illuminate\Foundation\PackageManifest->build()
#6 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Packag
eManifest.php(89): Illuminate\Foundation\PackageManifest->getManifest()
#7 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Packag
eManifest.php(78): Illuminate\Foundation\PackageManifest->config('aliases')
#8 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Bootst
rap\RegisterFacades.php(26): Illuminate\Foundation\PackageManifest->aliases()
#9 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Applic
ation.php(219): Illuminate\Foundation\Bootstrap\RegisterFacades->bootstrap(Object(Illuminate\Foundation\Application
))
#10 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Conso
le\Kernel.php(320): Illuminate\Foundation\Application->bootstrapWith(Array)
#11 C:\xampp\htdocs\Laravel-Library-Management-system-main\vendor\laravel\framework\src\Illuminate\Foundation\Conso
le\Kernel.php(129): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 C:\xampp\htdocs\Laravel-Library-Management-system-main\artisan(37): Illuminate\Foundation\Console\Kernel->handl
e(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main}

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

C:\xampp\htdocs\Laravel-Library-Management-system-main>composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: No git process found
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.5.0
PHP version: 8.1.10
PHP binary path: C:\xampp\php\php.exe
OpenSSL version: OpenSSL 1.1.1q 5 Jul 2022
cURL version: 7.77.0 libz 1.2.12 ssl OpenSSL/1.1.1q
zip: extension present, unzip not available, 7-Zip not available

C:\xampp\htdocs\Laravel-Library-Management-system-main>

@deepaksharma-507
Copy link

@SadafShk04 - Follow this link to first fix the PSR-4 issue.

@mohamedmehdigara
Copy link

Error with composer install

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
I also did composer update and composer diagnose but still the same error

@codecoreminion
Copy link

I'm such an idiot! The problem was starring me right in the face...

so what is the solution??

@maokimhuong19000
Copy link

i meet this proplem composer update not work

@php artisan package:discover --ansi

Warning: require(C:\xampp\php\www\MOE\moe_new_systemC:/xampp/php/pear/vendor.php): Failed to open stream: No such file or directory in C:\xampp\php\www\MOE\moe_new_system\artisan on line 18

Fatal error: Uncaught Error: Failed opening required 'C:\xampp\php\www\MOE\moe_new_systemC:/xampp/php/pear/vendor.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\php\www\MOE\moe_new_system\artisan:18
Stack trace:
#0 {main}
thrown in C:\xampp\php\www\MOE\moe_new_system\artisan on line 18
PHP Warning: require(C:\xampp\php\www\MOE\moe_new_systemC:/xampp/php/pear/vendor.php): Failed to open stream: No such file or directory in C:\xampp\php\www\MOE\moe_new_system\artisan on line 18PHP Fatal error: Uncaught Error: Failed opening required 'C:\xampp\php\www\MOE\moe_new_systemC:/xampp/php/pear/vendor.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\php\www\MOE\moe_new_system\artisan:18
Stack trace:
#0 {main}
thrown in C:\xampp\php\www\MOE\moe_new_system\artisan on line 18
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

@zahidilahi
Copy link

How can I fix the above issue?

@zahidilahi
Copy link

Solved it - >app folder should have console/kernel folder
Console.zip
add this folder to your app folder, and it will start working.

@KarishmaSharma24
Copy link

Solved it - >app folder should have console/kernel folder Console.zip add this folder to your app folder, and it will start working.

not working

@KarishmaSharma24
Copy link

so what is the solution ?

@fredden
Copy link
Contributor

fredden commented Dec 1, 2023

@KarishmaSharma24 this issue has been closed. If you still require help, I recommend you open a new issue and fill out the requested details there.

@roqueguardia
Copy link

I have the same issue in my project. I tried to fix it editing my dockerfile with:

composer self-update --stable
composer update --ignore-platform-reqs

But I still having the same issue on my Jenkins instance.
image
Any suggestions?

@roqueguardia
Copy link

Dockerfile:

FROM alpine:3.14

RUN apk \
    add apache2-ssl \ 
    apache2-ldap \
    apache2-utils \
    curl \
    php8-apache2 \
    php8-bcmath \
    php8-bz2 \
    php8-calendar \
    php8-common \
    php8-ctype \
    php8-curl \
    php8-dom \
    php8-gd \
    php8-iconv \
    php8-mbstring \
    php8-mysqli \
    php8-mysqlnd \
    php8-openssl \
    php8-pdo_mysql \
    php8-pdo_pgsql \
    php8-pdo_sqlite \
    php8-phar \
    php8-session \
    php8-xml \
    php8-ldap \ 
    php8-fileinfo \
    php8-simplexml \
    php8-tokenizer \
    php8-xmlwriter \
    php8-gettext \
    php8-exif \
    php8-xmlreader \
    php8-zip \
    nodejs \
    composer \
    npm \
    && rm -f /var/cache/apk/* \
    && mkdir /htdocs

RUN rm /usr/bin/php
RUN ln -s /usr/bin/php8 /usr/bin/php

RUN mkdir /etc/apache2/conf.d/certs
COPY /storage/apache/privada.unlam.edu.ar.key /etc/apache2/conf.d/certs/
COPY /storage/apache/publica.unlam.edu.ar.crt /etc/apache2/conf.d/certs/
COPY /storage/apache/php.ini-production /etc/php8/php.ini
COPY /storage/apache/httpd-alpine.conf /etc/apache2/httpd.conf
COPY /storage/apache/httpd-ssl-alpine.conf /etc/apache2/conf.d/ssl.conf
COPY /storage/apache/secret /secret

WORKDIR /var/www/localhost/htdocs

COPY /storage/apache/start.sh .

ADD . .

RUN chmod -R 777 storage
RUN apk add --no-cache --virtual .gyp python3 make g++ && npm install && apk del .gyp
#add --stable -W --lock 
RUN composer self-update --stable
RUN composer update --ignore-platform-reqs
#
RUN composer install --optimize-autoloader --no-dev
RUN npm config set registry https://registry.npmjs.org/
RUN npm install --global cross-env
RUN npm run production

EXPOSE 80 443

#HEALTHCHECK CMD wget -q --no-cache --spider localhost/index.html

ENTRYPOINT ["./start.sh"]

@olexoliinyk0
Copy link

@roqueguardia looks like support for Enums was added only with PHP 8.1 so you need to update your Dockerfile accordingly.

@olexoliinyk0
Copy link

Hi all, have similar a issue that occurs only in a CI pipeline after I've added a file to my composer.json->autoload->files (there were no "files" before that) like this:

"autoload": {
    "files": [
        "app/Helpers/bcmath.php" <-- this was added
    ],
    "psr-4": {
        "App\\": "app/",
        "Database\\Factories\\": "database/factories/",
        "Database\\Seeders\\": "database/seeders/"
    }
},

Locally it works fine after a one-time composer dump-autoload run, but in the CI pipeline it fails here:

Step 8/18 : RUN composer install --optimize-autoloader
Generating optimized autoload files
> Google\Task\Composer::cleanup
Removing 272 google services
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
Script Illuminate\Foundation\ComposerScripts::postAutoloadDump handling the post-autoload-dump event terminated with an exception
In autoload_real.php line 41:
                                                                               
  require(/var/www/html/laravelapp/vendor/composer/../../app/Helpers/bcmath.p  
  hp): Failed to open stream: No such file or directory

Soooo while I was writing this I kind of figured it out myself lol ))

The problem was in my Dockerfile:

# this is how it was and didn't work
COPY composer* ./
RUN composer install --optimize-autoloader
COPY ./ ./
RUN chmod 777 /var/www/html/laravelapp/bootstrap

# this is how I've changed it so it works now (repo files copied before `composer dump-autoload` runs, so file exists)
COPY ./ ./
RUN composer install --optimize-autoloader
RUN chmod 777 /var/www/html/laravelapp/bootstrap

Hope this will save someone a minute or two!

@roqueguardia
Copy link

@roqueguardia looks like support for Enums was added only with PHP 8.1 so you need to update your Dockerfile accordingly.

Yes, I had to change the most part of my Dockerfile with new dependencies that supports PHP 8.2 and replace alpine:3.14 for php:8.2-alpine

After that, It worked :)

@ThaisCp
Copy link

ThaisCp commented Jan 14, 2024

O Meu também está com este erro ao rodar composer intall, ou composer update apresenta a seguinte mensagem:

Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating optimized autoload files
Class App\db\cadastro\FinanceiroBancoConta located in C:/laragon/www/petshop/app\db\cadastro\FInanceiroBancoConta.php does not comply with psr-4 autoloading standard. Skipping.
Class App\db\financeiro\CentroCustoOperacao located in C:/laragon/www/petshop/app\db\financeiro\centroCustoOperacao.php does not comply with psr-4 autoloading standard. Skipping.
Class App\db\locadora\Contrato located in C:/laragon/www/petshop/app\db\petshop\Petshop.php does not comply with psr-4 autoloading standard. Skipping.
Class App\Post located in C:/laragon/www/petshop/app\Providers\Post.php does not comply with psr-4 autoloading standard. Skipping.
Class App\db\cadastro\FinanceiroBancoConta located in C:/laragon/www/petshop/app\db\cadastro\FInanceiroBancoConta.php does not comply with psr-4 autoloading standard. Skipping.
Class App\db\financeiro\CentroCustoOperacao located in C:/laragon/www/petshop/app\db\financeiro\centroCustoOperacao.php does not comply with psr-4 autoloading standard. Skipping.
Class App\db\locadora\Contrato located in C:/laragon/www/petshop/app\db\petshop\Petshop.php does not comply with psr-4 autoloading standard. Skipping.
Class App\Post located in C:/laragon/www/petshop/app\Providers\Post.php does not comply with psr-4 autoloading standard. Skipping.

Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover --ansi

Warning: require_once(C:\laragon\www\petshop/bootstrap/app.php): Failed to open stream: No such file or directory in C:\laragon\www\petshop\artisan on line 20

Fatal error: Uncaught Error: Failed opening required 'C:\laragon\www\petshop/bootstrap/app.php' (include_path='.;C:/laragon/etc/php/pear') in C:\laragon\www\petshop\artisan:20
Stack trace:
#0 {main}
thrown in C:\laragon\www\petshop\artisan on line 20
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

@olexoliinyk0
Copy link

@ThaisCp please check that some of your classes does not comply with PSR-4 - that means their namespace are not properly constructed and/or does not match the directory structure (like App\Post is not in app/Post.php but in app\Providers\Post.php for some reason -- the last "Skipping" line in your logs).

Then check that your project has a valid bootstrap/app.php file.

@erdum
Copy link

erdum commented Mar 3, 2024

I was having the same issue I found that my project does not have artisan file in the root, so I copied the artisan executable from another Laravel project and everything start to work again.

Make sure artisan file should not be included in the .gitignore it is placed when we install new Laravel project and cannot be installed by composer update or install, instead some scripts depends on artisan executable so make sure its availability in the project root.

Please like if it solves the issue, so others can take the benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests