Sage theme compatiblity issue
-
Hello, we’ve used your plugin in the past with no issues. We are now trying to install it in a new in development project that is using the Sage starter theme. In general everything works fine, but when we activate the plugin we get a fatal error coming from the logger Sage uses. There seems to be some sort of compatiblity issue.
As soon as we turn off the plugin the error goes away. We’ve also tried going back a few version to the latest version 4, but the issue seems to be the same.
I’ve seen a similar issue happen with the WPML plugin by doing some online digging where the way it was loading dependencies conflicted with Sage. Obviously not 100% related, but it was fixed there, so that might also be a pointer:
https://discourse.roots.io/t/solved-acorn-v3-v4-upgrade-psr-logger-issue-bedrock-wpml-fatal-error-declaration-of-monolog-logger-emergency/26987
The exact error is:
Fatal error: Declaration of Monolog\Logger::emergency(Stringable|string $message, array $context = []): void must be compatible with Psr\Log\LoggerInterface::emergency($message, array $context = []) in /var/www/html/wp-content/themes/martimex/vendor/monolog/monolog/src/Monolog/Logger.php on line 682
Fatal error: Uncaught Error: Class “Monolog\Logger” not found in /var/www/html/wp-content/themes/martimex/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php:60 Stack trace: #0 /var/www/html/wp-content/themes/martimex/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php(38): Monolog\Handler\AbstractHandler->setLevel(Object(Monolog\Level)) #1 /var/www/html/wp-content/themes/martimex/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php(49): Monolog\Handler\AbstractHandler->__construct(Object(Monolog\Level), true) #2 /var/www/html/wp-content/themes/martimex/vendor/illuminate/log/LogManager.php(187): Monolog\Handler\StreamHandler->__construct(‘/var/www/html/w…’, Object(Monolog\Level)) #3 /var/www/html/wp-content/themes/martimex/vendor/illuminate/log/LogManager.php(141): Illuminate\Log\LogManager->createEmergencyLogger() #4 /var/www/html/wp-content/themes/martimex/vendor/illuminate/log/LogManager.php(124): Illuminate\Log\LogManager->get(‘null’) #5 /var/www/html/wp-content/themes/martimex/vendor/illuminate/log/LogManager.php(681): Illuminate\Log\LogManager->driver() #6 /var/www/html/wp-content/themes/martimex/vendor/roots/acorn/src/Illuminate/Foundation/Exceptions/Handler.php(317): Illuminate\Log\LogManager->error(‘Declaration of …’, Array) #7 /var/www/html/wp-content/themes/martimex/vendor/roots/acorn/src/Illuminate/Foundation/Exceptions/Handler.php(278): Illuminate\Foundation\Exceptions\Handler->reportThrowable(Object(Symfony\Component\ErrorHandler\Error\FatalError)) #8 /var/www/html/wp-content/themes/martimex/vendor/roots/acorn/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(183): Illuminate\Foundation\Exceptions\Handler->report(Object(Symfony\Component\ErrorHandler\Error\FatalError)) #9 /var/www/html/wp-content/themes/martimex/vendor/roots/acorn/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(231): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\ErrorHandler\Error\FatalError)) #10 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown() #11 {main} thrown in /var/www/html/wp-content/themes/martimex/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php on line 60
- You must be logged in to reply to this topic.