4
votes

I was deploying my Laravel application and wanted to optimize the autoload normally with the command composer install --optimize-autoloader --no-dev. This is an application that runs Laravel 5.8.

composer install --optimize-autoloader --no-dev

I get the following error:

In Application.php line 662: Class 'BeyondCode\DumpServer\DumpServerServiceProvider' not found
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

3

3 Answers

4
votes

If you do not have development dependencies on the laravel-dump-server, remove the following line from composer.json.

"beyondcode/laravel-dump-server": "^1.0".

Then run the following command.

composer install

Or, even easier, just run the following.

composer remove --dev beyondcode/laravel-dump-server
0
votes

A detail around this issue has been written in one of the GitLab issues on
https://github.com/GoogleCloudPlatform/php-docs-samples/issues/736

This issue explain why this dev package creates problem on your build server.

For me, The issue resolved after I've added this in composer.json

{
    "scripts": {
        "gcp-build": [
            "composer install --no-dev"
        ]
    }
}

This will remove all the dev dependencies

-1
votes

You may need to run composer update with the --no-plugins option.

composer update --no-plugins