Search code examples
phpsymfonycomposer-phpsymfony3

TemplateListener error when trying to Symfony 3.4 beta3


I'm trying to migrate from Symfony 3.3.10 to Symfony 3.4 beta3. I have the following error:

Type error: Argument 1 passed to Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::__construct() must be an instance of Sensio\Bundle\FrameworkExtraBundle\Templating\TemplateGuesser, instance of ContainerWhrfjwe given, called in /home/coil/workspace/project/api/var/cache/dev/ContainerWhrfjwe/getDebug_EventDispatcherService.php on line 21

Here is what I have modified in my composer.json file:

"symfony/symfony": "v3.4.0-BETA3",
"symfony/swiftmailer-bundle": "^2.6.4",
"sensio/framework-extra-bundle": "^5.0.0",

Before:

"symfony/symfony": "3.3.*",
"symfony/swiftmailer-bundle": "^2.3.10",
"sensio/framework-extra-bundle": "^3.0.2",

(other lines where indentical)

The composer command works without error. But every pages raises this error. (even with CLI)


Solution

  • First - as usual, clear the dev-cache, and then try as it says on Upgrading a Minor Version:

    composer update symfony/symfony --with-dependencies
    

    It may also be useful to run

    composer outdated
    

    to see what other bundles, at least listed on the top-level, are out of date as well.