Javascript Symfony2,部署后找不到文件

Javascript Symfony2,部署后找不到文件,javascript,symfony,Javascript,Symfony,在live server上部署项目后,出现以下错误: An exception has been thrown during the compilation of a template ("Unable to find file "@JDareClankBundle/Resources/public/js/".") in "JDareClankBundle::client.html.twig". 清除缓存,转储资产 我在本地计算机上没有收到此错误。。。不知道怎么了 有什么想法吗 问候 检查您在

在live server上部署项目后,出现以下错误:

An exception has been thrown during the compilation of a template ("Unable to find file "@JDareClankBundle/Resources/public/js/".") in "JDareClankBundle::client.html.twig".
清除缓存,转储资产

我在本地计算机上没有收到此错误。。。不知道怎么了

有什么想法吗

问候

  • 检查您在开发和生产上的配置是否相同
  • 检查app/AppKernel.php在开发和生产上是否相同
  • 检查生产环境中是否存在该文件
  • 手动清除缓存:
    rm-rf-app/cache/*
    然后使用
    app/console-assets:install--env=prod
    安装资产,然后使用
    app/console-assetic:dump--env=prod

  • 在本地计算机上使用参数--env=prod执行第三步,查看是否出现错误

    奇怪的是,我从client.html.twig的clink中删除了{javascript}部分,清除了缓存,读取了它…现在它开始工作了。真奇怪