edition-php-twig-standard
edition-php-twig-standard copied to clipboard
can't generate
I can't use the generate command to build out patternlab.
I get this error:
Fatal Error Class ......\PatternEngineRule not found in ......\patternEngine.php on line 76
Wot sure why this is occurring.
I've used composer to build the demo (option 2) I did see this in the command line: [Alchemy\Zippy\Exception\RuntimeException] Unable to create the inflator
Maybe that has something to do with it? Thanks in advance!
I get the same error on Windows 10 with node 14.15.0, npm 6.14.8, php 8.0.0. Works fine on my linux box.
Here's the stack trace:
PHP Fatal error: Uncaught Error: Class "\PatternEngineRule" not found in C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\PatternEngine.php:71
Stack trace:
#0 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\PatternEngine.php(38): PatternLab\PatternEngine::loadRules()
#1 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\Builder.php(39): PatternLab\PatternEngine::init()
#2 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\Generator.php(34): PatternLab\Builder->__construct(Array)
#3 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\Console\Commands\GenerateCommand.php(41): PatternLab\Generator->__construct()
#4 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\Console.php(91): PatternLab\Console\Commands\GenerateCommand->run()
#5 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\core\console(46): PatternLab\Console::run()
#6 {main}
thrown in C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\PatternEngine.php on line 71
Fatal error: Uncaught Error: Class "\PatternEngineRule" not found in C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\PatternEngine.php:71
Stack trace:
#0 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\PatternEngine.php(38): PatternLab\PatternEngine::loadRules()
#1 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\Builder.php(39): PatternLab\PatternEngine::init()
#2 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\Generator.php(34): PatternLab\Builder->__construct(Array)
#3 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\Console\Commands\GenerateCommand.php(41): PatternLab\Generator->__construct()
#4 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\vendor\pattern-lab\core\src\PatternLab\Console.php(91): PatternLab\Console\Commands\GenerateCommand->run()
#5 C:\xampp\htdocs\wp-sandbox\wp-content\themes\dream\src\patternlab\core\console(46): PatternLab\Console::run()
#6 {main}
I suspect there was a problem with one of the installer scripts. In config/patternengines.json
I had
{"patternengines":["\\PatternEngineRule"]}
instead of
{"patternengines":["\\PatternLab\\PatternEngine\\Twig\\PatternEngineRule"]}
I fixed it manually rather than chase down the actual problem.
I believe this is a bug in patternlab-php-core
introduced with PHP 8.0.
I've created an issue here https://github.com/pattern-lab/patternlab-php-core/issues/177