0

我最近为我的 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 ...
4

1 回答 1

0

看起来您的 .js 文件中有错误

[错误] 277:10:无效的属性 ID

[错误] 277:11:语法错误

[错误] 278:4:语法错误

在 yuicompressor 打印的行中检查您的 .js 文件:

这是一个例子: http ://www.electrictoolbox.com/yui-compressor-troubleshooting-errors/

于 2013-01-17T19:52:53.323 回答