【问题标题】:Unable to replace alias "mea.twig.JsExtension" , Symfony 3.4 service alias无法替换别名“mea.twig.JsExtension”,Symfony 3.4 服务别名
【发布时间】:2018-04-05 14:53:29
【问题描述】:

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

【问题讨论】:

    标签: symfony symfony-3.4


    【解决方案1】:

    有 4 种可能的原因,它们可能完全被 Symfony\Component\DependencyInjection\Exception\InvalidArgumentException 类型的异常所低估:

    • ServiceNotFoundException;
    • ParameterNotFoundException;
    • EnvNotFoundException;
    • EnvParameterException

    我确定第一个异常是您问题的真正原因。

    【讨论】:

      猜你喜欢
      • 2017-04-25
      • 2020-02-07
      • 2023-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-28
      • 1970-01-01
      相关资源
      最近更新 更多