Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 7 Fatal error: Uncaught RuntimeException: A facade root has not been set

Tags:

I have looked at several answers suggested to a similar issue but nothing worked in my case. FYI, this is my first project in Laravel 7, working fine on my Mac. I have deployed the project on my server following this article. When running the project on the web, I get the following error :

Fatal error: Uncaught RuntimeException: A facade root has not been set. in /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:258

Stack trace: #0 /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(425): Illuminate\Support\Facades\Facade::__callStatic('replaceNamespac...', Array) #1 /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(402): Illuminate\Foundation\Exceptions\Handler->registerErrorViewPaths() #2 /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(313): Illuminate\Foundation\Exceptions\Handler->renderHttpException(Object(Symfony\Component\HttpKernel\Exception\HttpException)) #3 /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(210): Illuminate\Foundation\Exceptions\Handler->prepareResponse(Object(Illuminate\Http\Request), Object(Symfony\Component\HttpKernel\Exception\HttpExcepti in /usr/www/users/utopiqwvpw/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 258

How can I fix it?

like image 448
Paul Godard Avatar asked May 07 '20 06:05

Paul Godard


1 Answers

I finally found a solution that worked in my case.

  1. delete the folder vendor
  2. run composer update
  3. run php artisan config:cache
  4. run php artisan config:clear

Home page now displays but the routes do not work...

like image 185
Paul Godard Avatar answered Sep 21 '22 11:09

Paul Godard