8

I'm deploying my Laravel application and want to optimize the autoload, normally I would run the command

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

This is an application that runs Laravel 5.8. I am getting 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

Timothy G.
  • 6,335
  • 7
  • 30
  • 46
F. Dakia
  • 140
  • 1
  • 1
  • 9

6 Answers6

8

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
Karl Hill
  • 12,937
  • 5
  • 58
  • 95
  • Ok. when i do it. I have this warring for `composer` *`Dependency "laravel/framework" is also a root requirement, but is not explicitly whitelisted. Ignoring`* and the same error too. – F. Dakia Jul 09 '19 at 08:17
  • And/or 'composer dump-autoload' – Karl Hill Jul 09 '19 at 08:46
  • 1
    The command fails and show same error. I have locate `BeyondCode\\DumpServer\\DumpServerServiceProvider` in the bootstrap cache folder and when i remove the `packages.php` cache in `bootstrap/cache`. The `artisan clear-compiled` is ok. – F. Dakia Jul 09 '19 at 08:47
  • Normally, I had to do a `artisan clear-complied` before installing the `composer --optimize-autoloader --no-dev.` – F. Dakia Jul 09 '19 at 13:05
4

In my case I have done below steps

  1. Delete vendor folder
  2. Run: composer self-update --1
  3. And again run: composer install
  4. Then you can run any command you want
Bushra Mustofa
  • 1,075
  • 7
  • 12
1

Solution 1

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

if this not work try and getting error undefine index: Name Solution 2

Step1: `composer self-update --1`

Step2: composer install 

Bingo...!!!

0

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

0

I simply do

composer update

and then I redo again

like myself I run

php artisan migrate
Apit John Ismail
  • 2,047
  • 20
  • 19
-1

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

composer update --no-plugins
Karl Hill
  • 12,937
  • 5
  • 58
  • 95
Aminul
  • 67
  • 9