Error in Poser when performing dumpautoload

Asked

Viewed 494 times

0

I’m using Laravel 5.7 and when I execute the command

composer dumpautoload -o

I get the following error from commiserate:

[Runtimeexception] File at "/vendor/phpdocumentor/Reflection-common/src/Location.php" could not be Parsed as PHP, it may be Binary or corrupted

I already tried to delete the folder and do the update, also I have already deleted the whole folder /vendor, I cleaned the cache of Laravel and also commiserate, but nothing came of it.

My commodore:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "dompdf/dompdf": "^0.8.3",
        "fideloper/proxy": "^4.0",
        "graham-campbell/markdown": "^11.1",
        "intervention/image": "^2.5",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },
    "autoload": {
        "classmap": [
            "vendor/dompdf",
            "database/seeds",
            "database/factories"
        ],

        "files": [
                "app/Helpers.php"
        ],

        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}
  • I think not all dependencies allow autoload dump with -o, try running --no-dev to see the result.

  • Unfortunately the same problem occurs

  • Only dumpautoload works? You can [Dit] your question and include your Composer.json

  • Only dumpautload without flag also does not work, this problem only occurs on the server on my local machine it updates normally without any fault, updated with the data from Composer.

  • This classmap in "vendor/dompdf" is strange...

  • @gmsantos is due to a flaw in the inclusion of the package, when it does require it does not include the autoload classes of the package in a complete way (dompdf error not from Composer) and is pointing to the lack of a customization class, so the mapping of this particular package, but it does not cause failures because of this.

  • I don’t know how else I can help you. I created a new project with Laravel 5.7, took your Composer.json, created the app/Helpers.php file and could not reproduce your problem. Here the dumpautoload -o worked

  • Some things you can try: update Composer, remove the vendor directory and your Composer.lock, and try again. Other than that, I have no other suggestions;

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.