phplaravellaravel-facade

updating Laravel from 5.7 to 5.8 results in this error: Fatal error: Uncaught RuntimeException: A facade root has not been set


Here's a list of posts claiming they have the same error I've already looked at and tried the answers from but none of them have worked:

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

I'm updating Laravel from 5.7 to 5.8.

A coworker started the upgrade using the instructions here. I then pulled their branch down from github and ran the following commands:

composer clearcache

php artisan cache:clear

composer install -o -vvv

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

a different co-worker went through this same process and does not get any errors. I get the following error when running the composer update command:

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

None of the answers listed above have worked for me in this situation and we're running out of ideas as to what the issue is.

Any ideas of how to proceed in troubleshooting this issue?


Solution

  • After much searching we figured out what the problem was. In updating our version of Laravel one of our 3rd party dependency packages (vlucas/phpdotenv) we use had a version update too and that package had a breaking change. It slipped through the cracks. After going through the steps to update that 3rd party package our problem was solved.