无法替换别名" mea.twig.JsExtension" ,Symfony 3.4服务别名

时间:2018-04-05 14:53:29

标签: symfony symfony-3.4

services.yml

mea.twig.JsExtension:
    alias: Mea\CoreBundle\Twig\MeaExtension
    public: true
    arguments: ["@service_container","@kernel", "@mea.metatags", "@mea.asset"]
    tags:
        - { name: twig.extension }

给出错误

InvalidArgumentException
Unable to replace alias "mea.twig.JsExtension" with actual definition "Mea\CoreBundle\Twig\MeaExtension".

in ReplaceAliasByActualDefinitionPass.php (line 57)
at ReplaceAliasByActualDefinitionPass->process(object(ContainerBuilder))
in Compiler.php (line 141)
at Compiler->compile(object(ContainerBuilder))
in ContainerBuilder.php (line 759)
at ContainerBuilder->compile()
in Kernel.php (line 643)

Symfony 3.4

1 个答案:

答案 0 :(得分:0)

有4种可能的原因,Symfony\Component\DependencyInjection\Exception\InvalidArgumentException类型的例外情况可能会完全忽视它们:

  • ServiceNotFoundException;
  • ParameterNotFoundException;
  • EnvNotFoundException;
  • EnvParameterException

我确信第一个例外是您问题的真正原因。