将Laravel从5.7更新到5.8会导致以下错误:致命错误:Uncaught RuntimeException:尚未设置外观根

时间:2019-07-02 20:49:15

标签: php laravel laravel-facade

这是一则帖子列表,声称它们具有我已经看过的相同错误并尝试了答案,但没有一个起作用:

Laravel 5.6 - Uncaught RuntimeException: A facade root has not been set

'A Facade root has not been set' when running `composer install` after a fresh checkout

Laravel 5.5 application not booting anymore with "A facade root has not been set."

Laravel error 'A facade root has not been set

Laravel 5.6 Uncaught RuntimeException: A facade root has not been set. in vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:218

https://laracasts.com/discuss/channels/laravel/updating-from-55-to-56-resulting-in-a-facade-root-has-not-been-set?page=1

我要将Laravel从5.7更新到5.8。

同事按照here的说明开始升级。然后,我从github下拉了他们的分支,并运行了以下命令:

composer clearcache

php artisan cache:clear

composer install -o -vvv

rm -rf vendor/ rm composer.lock && composer update -o -vvv

另一个同事也经历了相同的过程,并且没有出现任何错误。运行composer update命令时出现以下错误:

PHP Fatal error:  Uncaught RuntimeException: A facade root has not been set. in /dev/api/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:234
Stack trace:
#0 /dev/api/app/Exceptions/Handler.php(51): Illuminate\Support\Facades\Facade::__callStatic('error', Array)
#1 /dev/api/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(378): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#2 /dev/api/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(143): Illuminate\Foundation\Console\Kernel->reportException(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#3 /dev/api/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 {main}
  thrown in /dev/api/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 234

在这种情况下,上面列出的答案中没有一个对我有用,我们对于问题的根源已经不多了。

关于如何解决此问题的任何想法?

1 个答案:

答案 0 :(得分:1)

经过大量搜索,我们找出了问题所在。在更新我们的Laravel版本时,我们使用的第三方依赖项软件包之一(vlucas / phpdotenv)也进行了版本更新,并且该软件包具有重大更改。它滑过裂缝。在完成了更新第三方软件包的步骤之后,我们的问题已解决。