Symfony 无法加载 TwigRenderer 运行时

Symfony Unable to load the TwigRenderer runtime

我从 Symfony 3. 升级到 3.4.2。我在页面包上遇到了这个错误:

无法加载 "Symfony\Bridge\Twig\Form\TwigRenderer" 运行时。

我尝试将 twig 包升级到最新版本(在撰写此行时)v2.4.4 但没有成功。 请帮忙。

这是错误堆栈跟踪:

Twig_Error_Runtime:
Unable to load the "Symfony\Bridge\Twig\Form\TwigRenderer" runtime.

  at vendor/twig/twig/lib/Twig/Environment.php:663
  at Twig_Environment->getRuntime('Symfony\Bridge\Twig\Form\TwigRenderer')
     (vendor/sonata-project/page-bundle/src/Controller/PageAdminController.php:104)
  at Sonata\PageBundle\Controller\PageAdminController->treeAction(object(Request))
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (web/app_dev.php:28)

此错误已通过将 sonata 页面包升级到 3.7.1 得到修复