AssetMinificationExeception

Apr 11, 2013 at 12:01 AM
Any ideas what would cause this?

        BundleTransformer.Core.Minifiers.AssetMinificationException: During minification of JS-code, readed from the file ~/_Content/Areas/Clinician/TabManager.js, by YUI JS-minifier error has occurred.  

See more details:



Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

   at System.Collections.ArrayList.get_Item(Int32 index)

   at Yahoo.Yui.Compressor.JavaScriptCompressor.ProcessStringLiterals(IList tokens, Boolean merge)

   at Yahoo.Yui.Compressor.JavaScriptCompressor.DoCompress(String source)

   at BundleTransformer.Yui.Minifiers.YuiJsMinifier.Minify(IList`1 assets)

   --- End of inner exception stack trace ---

   at BundleTransformer.Yui.Minifiers.YuiJsMinifier.Minify(IList`1 assets)

   at BundleTransformer.Core.Transformers.TransformerBase.Minify(IList`1 assets)

   at BundleTransformer.Core.Transformers.JsTransformer.Transform(IList`1 assets, BundleResponse bundleResponse, VirtualPathProvider virtualPathProvider, HttpContextBase httpContext)

   at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext context, BundleResponse response)

   at System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable`1 bundleFiles)

   at System.Web.Optimization.Bundle.GetBundleResponse(BundleContext context)

   at System.Web.Optimization.BundleResolver.GetBundleContents(String virtualPath)

   at System.Web.Optimization.AssetManager.EliminateDuplicatesAndResolveUrls(IEnumerable`1 refs)

   at System.Web.Optimization.AssetManager.DeterminePathsToRender(IEnumerable`1 assets)

   at System.Web.Optimization.AssetManager.RenderExplicit(String tagFormat, String[] paths)

   at ASP._Page_Areas_Clinician_Views_Shared__PatientTabsLayout_cshtml.b__6() in c:\inetpub\wwwroot\uat\clinic\Areas\Clinician\Views\Shared\_PatientTabsLayout.cshtml:line 34

   at System.Web.WebPages.WebPageBase.<>c__DisplayClassb.b__9(TextWriter tw)

   at System.Web.WebPages.WebPageBase.Write(HelperResult result)

   at ASP._Page_Areas_Clinician_Views_Shared__ClinicianLayout_cshtml.b__11() in c:\inetpub\wwwroot\uat\clinic\Areas\Clinician\Views\Shared\_ClinicianLayout.cshtml:line 51

   at System.Web.WebPages.WebPageBase.<>c__DisplayClassb.b__9(TextWriter tw)

   at System.Web.WebPages.WebPageBase.Write(HelperResult result)

   at ASP._Page_Views_Shared__Layout_cshtml.Execute() in c:\inetpub\wwwroot\uat\clinic\Views\Shared\_Layout.cshtml:line 122

   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()

   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()

   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)

   at System.Web.WebPages.WebPageBase.Write(HelperResult result)

   at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)

   at System.Web.WebPages.WebPageBase.PopContext()

   at System.Web.WebPages.WebPageBase.Write(HelperResult result)

   at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)

   at System.Web.WebPages.WebPageBase.PopContext()

   at System.Web.WebPages.WebPageBase.Write(HelperResult result)

   at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)

   at System.Web.WebPages.WebPageBase.PopContext()

   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)

   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.b__19()

   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)

   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)

   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)

   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)

   at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)

   at System.Web.Mvc.Controller.ExecuteCore()

   at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)

   at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<>c__DisplayClassb.b__5()

   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.b__0()

   at System.Web.Mvc.MvcHandler.<>c__DisplayClasse.b__d()

   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Coordinator
Apr 11, 2013 at 7:39 AM
Hello, Meno!

No ideas, because error occurs at the level of YUI Compressor for. Net library.

You have to understand, that not every JS or CSS code can be compressed by using minifiers. Try to compress this code by using the BundleTransformer.MicrosoftAjax or BundleTransformer.UglifyJs.