pug-php / pug-symfony

Pug (Jade) template engine for Symfony

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86 Symfony 4.2.8

pedroresende opened this issue · comments

After a clean installation of Symfony, I've installed the pug-symfony extension by running the command

$ composer require pug-php/pug-symfony

at the end of the installation I'm getting the following error

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!  
!!  In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:
!!                                                                                 
!!    The service "templating" has a dependency on a non-existent service "templa  
!!    ting.engine.twig".                                                           
!!                                                                                 
!!  
!!  

This error is due to the missing twig extension, shouldn't it be automatically installed ?

commented

A clean installation of Symfony should come with Twig, can you precise the install command you ran?

I've followed the documentation (https://symfony.com/download), I agree I should have installed the traditional option and not the API one, but even though it should deal with it, shouldn't it ?

commented

In fact Pug-symfony can work without Twig. But if Twig is present it will port Twig functions and services to be available in pug templates. So peer dependency remains the more appropriate. You can either install Twig (and I think the error message is explicit enough) to get the full-featured engine or remove twig from "templating" service config to get free from Twig.

I don't think we should "force" the install of Twig as a strong dependency.

Ok, but it shouldn't it be mentioned in the documentation at least ?

commented

Done: https://github.com/pug-php/pug-symfony/blob/master/README.md#install

Please tell me if you have any trouble installing Twig or removing the service.