assetic.ERROR “DoctrineBundle:Collector:db.html.twig” contains an error: Unknown “profiler_dump” function

后端 未结 3 454
抹茶落季
抹茶落季 2021-01-19 01:01

I am trying to send emails with Symfony. Everything works perfect locally. But on server I get following errore in prod.log:

assetic.ERROR: The te

相关标签:
3条回答
  • 2021-01-19 01:18

    By default, AsseticBundle will try to handle the templates of all enabled bundles which leads to errors when enabled bundles ship with templates that rely on features not being loaded in the prod environment. You can solve your issue by explicitly listing all bundles that should be handled by Assetic using the assetic.bundles option.

    0 讨论(0)
  • 2021-01-19 01:22

    I've solved this by creating twig extension defining empty function profiler_dump and loading this twig extension only in production.

    0 讨论(0)
  • 2021-01-19 01:30

    profiler_dump method comes from Symfony's WebProfilerBundle. This bundle is not applied to Kernel in production mode, and it should not be (WebProfiler toolbar should be enabled only during development). You should remove those calls from twig template.

    0 讨论(0)
提交回复
热议问题