yeswework / fabrica-dev-kit

A toolkit for faster, smoother WordPress 5 development
https://fabri.ca/
MIT License
274 stars 27 forks source link

Twig error happened when switching theme #8

Closed maxperei closed 7 years ago

maxperei commented 7 years ago

hi there, i've got trouble when i switch theme (from twentyseventeen to mine), i got this : Catchable fatal error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /var/www/html/wp-content/themes/mcs/inc/vendor/timber/timber/lib/Twig.php on line 173 and defined in /var/www/html/wp-content/themes/mcs/inc/vendor/twig/twig/lib/Twig/Filter.php on line 35 i have no idea what to do, i thought it was supposed to work without efforts 😞

tiojoca commented 7 years ago

Hi @maxperei, something must have gone wrong during the setup process, you shouldn't even have the default twentyseventeen theme installed (it's removed during setup) or have to activate yours.

Can you try and repeat the process and send any errors or suspicious messages?

maxperei commented 7 years ago

ok, to make it work i had to downgrade twig module by running composer require twig/twig=1.* inside src/includes

i'll try to repeat the process from scratch and send a feedback, thank you

maxperei commented 7 years ago

i restart everything, same problem, when i run composer install (it's not automatic in my case) twig version 2.3.2 is incompatible with the php version which is 5.6.30 either i downgrade twig to a previous version or i upgrade to php 7 then, i've got this ->

capture d ecran 2017-05-05 a 16 18 51

is it what it should be ?

tiojoca commented 7 years ago

Thanks @maxperei! That looks fine. There's no default styles in the starter theme, just some very rudimentary markup in a few basic templates, which is why it looks so basic.

It's strange that you have to run composer install manually and that the Twig version it installs is 2.3.2. We're only setting Timber as a dependency in composer.json and the Twig version required there is 1.*.

Do you get an error when setup.rb tries to run Composer?