Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twig Symfony3细枝资产分析错误_Twig_Symfony_Assetic - Fatal编程技术网

Twig Symfony3细枝资产分析错误

Twig Symfony3细枝资产分析错误,twig,symfony,assetic,Twig,Symfony,Assetic,在prod中清除缓存时,出现以下错误: Twig_Error_Syntax: Lexer or parser ended up in unsupported state 只有在使用命名资产时才会发生这种情况: {% stylesheets '@bootstrap_css' %} 使用资源路径时: {% stylesheets 'Resources/css/lib/bootstrap.min.css' %} 没关系 My config.yml: assetic: assets:

在prod中清除缓存时,出现以下错误:

Twig_Error_Syntax: Lexer or parser ended up in unsupported state
只有在使用命名资产时才会发生这种情况:

{% stylesheets '@bootstrap_css' %}
使用资源路径时:

{% stylesheets 'Resources/css/lib/bootstrap.min.css' %}
没关系

My config.yml:

assetic:
    assets:
        bootstrap_css:
            inputs:
                - Resources/css/lib/bootstrap.min.css
                - Resources/css/lib/bootstrap-theme.min.css
            output: compiled/css/bootstrap.css
有什么想法吗?

我看不到列表中列出的“输出”

试着评论一下,看看会发生什么

第二次编辑:

也可以尝试完整路径。我在Symfony的assetic网站上看到一条评论,认为这可能不起作用(但我不确定):

{%stylesheets'Resources/css/lib/*'%}


请参阅下面关于“资产路径”的评论,以供参考。

我遇到了完全相同的问题。我在选项中定义了输出,尝试将其删除,但没有成功。我也在使用过滤器,所以我认为这可能与此有关。没有


我最终用定义的过滤器在我的细枝模板中定义了资产组,错误停止了。我认为这可能是一个bug,直到今天仍然存在。

清除缓存后,一定要转储资产:

php bin/console assetic:dump --env=prod

这对我很有帮助。

更新了我的帖子-我想你需要我的第二个选项。是的,在我的主要帖子中,我写了完整路径的选项正在工作。但命名资产的错误仅在清除缓存后发生。刷新后一切正常:/n由于此问题而发生