我最近为我的symfony安装配置了yuicompressor。但我不能让它发挥作用。我总是收到如下所示的错误消息。我尝试过滤哪些javascript代码并不重要。有人有什么想法吗?我不知道如何/在哪里解决这个问题。
[Assetic\Exception\FilterException]
An error occurred while running:
'/usr/bin/java' '-jar' '/var/www/vhosts/domain.de/httpdocs/sf/app/Resources/java/yuicompressor-2.4.7.jar' '--charset' 'UTF-8' '-o' '/tmp/YUI-OUT-941hD3' '--type' 'js' '/tmp/YUI-IN-ll8QOg'
Error Output:
[ERROR] 277:10:invalid property id
[ERROR] 277:11:syntax error
[ERROR] 278:4:syntax error
[ERROR] 1:0:Compilation produced 3 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 3 syntax errors.
at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:154)
at org.mozilla.javascript.Parser.parse(Parser.java:392)
at org.mozilla.javascript.Parser.parse(Parser.java:337)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:131)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)
Input:
... random javascript code goes here ...
答案 0 :(得分:0)
您的.js文件中似乎有错误
[错误] 277:10:无效的属性ID
[错误] 277:11:语法错误
[错误] 278:4:语法错误
检查由yuicompressor打印的行中的.js文件:
这是一个例子: http://www.electrictoolbox.com/yui-compressor-troubleshooting-errors/