Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ilhammerug's avatar

Uncaught RuntimeException: A facade root has not been set

Hi guys, i just installed laravel 9 app in nginx server And i got this error

Uncaught RuntimeException: A facade root has not been set. in /www/wwwroot/www.myapp.com/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:335 Stack trace:

Can you help me with this?

0 likes
1 reply
tisuchi's avatar

@ilhammerug Based on my understanding, such kinds of error occurs when you are trying to use a Laravel facade before the application has been fully bootstrapped. Facades are essentially static interfaces to classes in the service container, and they rely on the Laravel service container to be available in order to function properly.

To fix this issue, you will need to ensure that your application has been fully bootstrapped before you attempt to use any facades. This usually means that you need to move any code that uses facades to a place where it will be executed after the service container has been initialized.

1 like

Please or to participate in this conversation.