无法使用 Combres 和 yui 进行缩小

发布于 2024-12-15 03:59:49 字数 4566 浏览 2 评论 0原文

我不知道如何找出有关我的 .js 文件有什么问题的更多信息,但是如果我打开“defaultDebugEnaled = true”那么它工作正常,但是将其设置为 false 会让我收到此错误

而且我似乎无法切换任何使它给我一个更具体的错误的东西,我只知道它在尝试缩小它时失败了。

此外,只有当我包含一个特定文件时才会发生这种情况,但这是工作,所以不能只发布该文件。

 Server Error in '/' Application.

 [ERROR] missing formal parameter

 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.InvalidOperationException: [ERROR] missing formal parameter

 Source Error: 

 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

 Stack Trace: 


 [InvalidOperationException: [ERROR] missing formal parameter]
   Yahoo.Yui.Compressor.CustomErrorReporter.Error(String message, String sourceName, Int32 line, String lineSource, Int32 lineOffset) +61
   EcmaScript.NET.Parser.AddError(String messageId) +94
   EcmaScript.NET.Parser.ReportError(String messageId) +9
   EcmaScript.NET.Parser.function(Int32 functionType) +700
   EcmaScript.NET.Parser.parseFunctionBody() +138
   EcmaScript.NET.Parser.function(Int32 functionType) +932
   EcmaScript.NET.Parser.primaryExpr() +334
   EcmaScript.NET.Parser.memberExpr(Boolean allowCallSyntax) +213
   EcmaScript.NET.Parser.unaryExpr() +605
   EcmaScript.NET.Parser.mulExpr() +16
   EcmaScript.NET.Parser.addExpr() +16
   EcmaScript.NET.Parser.shiftExpr() +16
   EcmaScript.NET.Parser.relExpr(Boolean inForInit) +21
   EcmaScript.NET.Parser.eqExpr(Boolean inForInit) +25
   EcmaScript.NET.Parser.bitAndExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.bitXorExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.bitOrExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.andExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.orExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.condExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.assignExpr(Boolean inForInit) +28
   EcmaScript.NET.Parser.expr(Boolean inForInit) +23
   EcmaScript.NET.Parser.primaryExpr() +1233
   EcmaScript.NET.Parser.memberExpr(Boolean allowCallSyntax) +213
   EcmaScript.NET.Parser.unaryExpr() +605
   EcmaScript.NET.Parser.mulExpr() +16
   EcmaScript.NET.Parser.addExpr() +16
   EcmaScript.NET.Parser.shiftExpr() +16
   EcmaScript.NET.Parser.relExpr(Boolean inForInit) +21
   EcmaScript.NET.Parser.eqExpr(Boolean inForInit) +25
   EcmaScript.NET.Parser.bitAndExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.bitXorExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.bitOrExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.andExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.orExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.condExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.assignExpr(Boolean inForInit) +28
   EcmaScript.NET.Parser.expr(Boolean inForInit) +23
   EcmaScript.NET.Parser.statementHelper(Node statementLabel) +9649
   EcmaScript.NET.Parser.statement() +71
   EcmaScript.NET.Parser.Parse() +333
   EcmaScript.NET.Parser.Parse(StreamReader sourceReader, String sourceURI, Int32 lineno) +64
   Yahoo.Yui.Compressor.JavaScriptCompressor.Parse(StreamReader stream, ErrorReporter reporter) +71
   Yahoo.Yui.Compressor.JavaScriptCompressor..ctor(String javaScript, Boolean isVerboseLogging, Encoding encoding, CultureInfo threadCulture, Boolean isEvalIgnored, ErrorReporter errorReporter) +391
   Yahoo.Yui.Compressor.JavaScriptCompressor.Compress(String javaScript, Boolean isVerboseLogging, Boolean isObfuscateJavascript, Boolean preserveAllSemicolons, Boolean disableOptimizations, Int32 lineBreakPosition, Encoding encoding, CultureInfo threadCulture, Boolean isEvalIgnored) +73
   Combres.Minifiers.YuiJSMinifier.Minify(Settings settings, ResourceSet resourceSet, String combinedContent) +355
   Combres.RequestProcessor.MinifyContent(MinifierInfo minifierInfo, IEnumerable`1 resources, String combinedContent) +340
   Combres.DefaultProcessingWorkflow.ProcessMergeGroup(ICollection`1 minifiedContents, IEnumerable`1 mergeGroup, MinifierInfo currentMinifier) +63
   Combres.DefaultProcessingWorkflow.Execute() +344
   Combres.RequestProcessor.Execute() +160
   Combres.CombresHandler.ProcessRequest(HttpContext context) +94
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

I am not sure how to find out more about whats wrong with my .js file, but if I turn "defaultDebugEnaled = true" then it works fine, but putting it to false makes me get this error

And I can't seem to toggle anything to make it give me a more specific error, I only know that it fails when trying to minify it.

Also this only happens when I include one certain file, but this is work so can't just post that file.

 Server Error in '/' Application.

 [ERROR] missing formal parameter

 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.InvalidOperationException: [ERROR] missing formal parameter

 Source Error: 

 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

 Stack Trace: 


 [InvalidOperationException: [ERROR] missing formal parameter]
   Yahoo.Yui.Compressor.CustomErrorReporter.Error(String message, String sourceName, Int32 line, String lineSource, Int32 lineOffset) +61
   EcmaScript.NET.Parser.AddError(String messageId) +94
   EcmaScript.NET.Parser.ReportError(String messageId) +9
   EcmaScript.NET.Parser.function(Int32 functionType) +700
   EcmaScript.NET.Parser.parseFunctionBody() +138
   EcmaScript.NET.Parser.function(Int32 functionType) +932
   EcmaScript.NET.Parser.primaryExpr() +334
   EcmaScript.NET.Parser.memberExpr(Boolean allowCallSyntax) +213
   EcmaScript.NET.Parser.unaryExpr() +605
   EcmaScript.NET.Parser.mulExpr() +16
   EcmaScript.NET.Parser.addExpr() +16
   EcmaScript.NET.Parser.shiftExpr() +16
   EcmaScript.NET.Parser.relExpr(Boolean inForInit) +21
   EcmaScript.NET.Parser.eqExpr(Boolean inForInit) +25
   EcmaScript.NET.Parser.bitAndExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.bitXorExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.bitOrExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.andExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.orExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.condExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.assignExpr(Boolean inForInit) +28
   EcmaScript.NET.Parser.expr(Boolean inForInit) +23
   EcmaScript.NET.Parser.primaryExpr() +1233
   EcmaScript.NET.Parser.memberExpr(Boolean allowCallSyntax) +213
   EcmaScript.NET.Parser.unaryExpr() +605
   EcmaScript.NET.Parser.mulExpr() +16
   EcmaScript.NET.Parser.addExpr() +16
   EcmaScript.NET.Parser.shiftExpr() +16
   EcmaScript.NET.Parser.relExpr(Boolean inForInit) +21
   EcmaScript.NET.Parser.eqExpr(Boolean inForInit) +25
   EcmaScript.NET.Parser.bitAndExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.bitXorExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.bitOrExpr(Boolean inForInit) +23
   EcmaScript.NET.Parser.andExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.orExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.condExpr(Boolean inForInit) +26
   EcmaScript.NET.Parser.assignExpr(Boolean inForInit) +28
   EcmaScript.NET.Parser.expr(Boolean inForInit) +23
   EcmaScript.NET.Parser.statementHelper(Node statementLabel) +9649
   EcmaScript.NET.Parser.statement() +71
   EcmaScript.NET.Parser.Parse() +333
   EcmaScript.NET.Parser.Parse(StreamReader sourceReader, String sourceURI, Int32 lineno) +64
   Yahoo.Yui.Compressor.JavaScriptCompressor.Parse(StreamReader stream, ErrorReporter reporter) +71
   Yahoo.Yui.Compressor.JavaScriptCompressor..ctor(String javaScript, Boolean isVerboseLogging, Encoding encoding, CultureInfo threadCulture, Boolean isEvalIgnored, ErrorReporter errorReporter) +391
   Yahoo.Yui.Compressor.JavaScriptCompressor.Compress(String javaScript, Boolean isVerboseLogging, Boolean isObfuscateJavascript, Boolean preserveAllSemicolons, Boolean disableOptimizations, Int32 lineBreakPosition, Encoding encoding, CultureInfo threadCulture, Boolean isEvalIgnored) +73
   Combres.Minifiers.YuiJSMinifier.Minify(Settings settings, ResourceSet resourceSet, String combinedContent) +355
   Combres.RequestProcessor.MinifyContent(MinifierInfo minifierInfo, IEnumerable`1 resources, String combinedContent) +340
   Combres.DefaultProcessingWorkflow.ProcessMergeGroup(ICollection`1 minifiedContents, IEnumerable`1 mergeGroup, MinifierInfo currentMinifier) +63
   Combres.DefaultProcessingWorkflow.Execute() +344
   Combres.RequestProcessor.Execute() +160
   Combres.CombresHandler.ProcessRequest(HttpContext context) +94
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

澉约 2024-12-22 03:59:49

“缺少形式参数”意味着函数定义缺少参数。例如,

/**
 * @param x ...
 * @param y ...
 */
function f(x) {  // Only one formal parameter.
  ...
}

f(1, 2);  // Called with 2 actual parameters.

函数f缺少形式参数y

编辑:

https://github.com/wycats/handlebars.js/issues/93 讨论了类似的问题,并指出问题在于 YUI 压缩器将某些 JS 标识符(错误地)视为保留字,并在将保留字用作形式参数时发出此错误

$ java -jar lib/closurecompiler.jar --js js/handlebars.1.0.0.beta.3.js 
js/handlebars.1.0.0.beta.3.js:667:错误 - 解析错误。缺少形式参数
Handlebars.AST.BooleanNode = 函数(布尔值) {

我有一个版本似乎可以在我的 fork 中运行。主要变化是用 s/boolean/bool/g 删除保留字
还对输入 .js 文件进行了 linting 以保持一致性。

"Missing formal parameter" means that a function definition is missing a parameter. For example

/**
 * @param x ...
 * @param y ...
 */
function f(x) {  // Only one formal parameter.
  ...
}

f(1, 2);  // Called with 2 actual parameters.

the function f is missing a formal parameter y.

EDIT:

https://github.com/wycats/handlebars.js/issues/93 discusses a similar issue and suggests the problem is that YUI compressor treats certain JS identifiers (incorrectly) as reserved words and issues this error when a reserved word is used as a formal parameter

$ java -jar lib/closurecompiler.jar --js js/handlebars.1.0.0.beta.3.js 
js/handlebars.1.0.0.beta.3.js:667: ERROR - Parse error. missing formal parameter
Handlebars.AST.BooleanNode = function(boolean) {

I have a version that seems to be working in my fork. Main change was to remove reserved word with s/boolean/bool/g
Also linted the input .js files for consistency.

我要还你自由 2024-12-22 03:59:49

使用如下参数时也会出现此错误:

function functionName( markers, boolean )

在这种情况下 boolean 将导致错误。

This error can also appear when using parametres like this:

function functionName( markers, boolean )

In this case boolean will cause the error.

指尖凝香 2024-12-22 03:59:49

我昨天遇到了同样的问题(结果是“长”使用了一个参数 - 我刚刚重命名为经度) - 对我来说最好的方法是将 JS 手动提供给这两个工具: http://www.javascriptlint.com/online_lint.php 和在线 YUI 压缩器 http://refresh-sf.com/yui/

在两者之间很容易找到错误并验证它会压缩。

I had this same problem yesterday (which turned out to be 'long' used a parameter - i just renamed to longitude) - and the best approach for me was to feed the JS manually to these two tools: http://www.javascriptlint.com/online_lint.php and an online YUI compressor http://refresh-sf.com/yui/

between the two it was easy to find the errors and verify that it would compress.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文