douguai4653 2019-08-02 09:58
浏览 92

webpack-encore-bundle未知“encore_entry_script_tags”函数

Issue is with symfony 4, php 7.3.7.

I have ran composer require symfony/webpack-encore-bundle and added the default webpack.config.js as recommend in the documentation.

When I add {{ encore_entry_script_tags('app') }} to my base.html.twig I get an error saying that the function is unknown.

Google is leading me nowhere and the documentation says that it is good to go right out of the box if you have symfony flex, which I do.

I tried adding a webpack_encore.yaml to config/packages but it threw an error saying that there is no package to build with this configuration.

Any ideas what I could be missing?

  • 写回答

1条回答 默认 最新

  • dpz3471 2019-08-03 11:26
    关注

    please be sure your config/bundles.php has this line.

    return [
        ...
        Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
        ...
    ];
    

    also check 'config/packages/webpack_encore.yaml' is exist. Here is default config.

    webpack_encore:    
        output_path: '%kernel.project_dir%/public/build'
    
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器