php-docs-samples: Class 'BeyondCode\DumpServer\DumpServerServiceProvider' not found
I try to install Laravel 5.7 but i always got error "Class 'BeyondCode\DumpServer\DumpServerServiceProvider' not found".
Its new on Laravel 5.7, and already on composer.json but why it can’t be load?
its my composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "7.2.*",
"fideloper/proxy": "^4.0",
"google/cloud": "^0.82.0",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.2",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"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"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"chmod -R 755 bootstrap\/cache"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"chmod -R 755 bootstrap\/cache"
],
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (6 by maintainers)
@PrimeException I now understand the issue better, after talking to someone on the project. The App Engine build server installs dev dependencies so that if scripts need to be run which are not used in production, the dev dependencies are there.
Because Laravel creates
bootstrap/cache/services.php
as part of theartisan package:discover
command, thebeyondcode/laravel-dump-server
package is discovered, loaded intoservices.php
, and then fails to load in production.So the good news is, your dev dependencies are NOT being loaded into production. The bad news is, your
services.php
file inaccurately reflects the dependencies loaded into the Cloud Build environment.The best workaround is to run
composer remove --dev beyondcode/laravel-dump-server
. A more complete workaround would be to add the following tocomposer.json
:This workaround will remove all dev dependencies on the build server.
Running that command created the same error:
The solution for me was to run the following command to install this module:
composer require --dev beyondcode/laravel-dump-server
now my website run properly when
i downgrade my Laravel version to 5.7.5i removebeyondcode/laravel-dump-server
from mycomposer.json
on Laravel 5.7.6+this my last working
composer.json
Using the flexible environment also resolves the issue because the flexible environment does not install development dependencies by default, like it’s supposed to.
Development dependencies should never be installed by default and any workarounds should be to install development dependencies, not prevent their installation.
This is a bug, regardless if someone “intended” to do it.
On Fri, Feb 1, 2019, 20:36 Brent Shaffer <notifications@github.com wrote:
There is a bug in “update-vendor-directory” in app engine that runs composer update and installs development dependencies regardless of settings.
You should never update production code, that’s why the lock file exists.
The build script needs to be changed from “composer update” to “composer install --no-dev”
I submitted a bug report and they claimed that updating and installing development dependencies in production is intended behavior.
They clearly have no idea what they’re doing.
On Fri, Feb 1, 2019, 18:02 Brent Shaffer <notifications@github.com wrote: