Minification failed. Returning unminified contents and BundleTable.EnableOptimizations = true

17 posts, 0 answers
  1. Ross B.
    Ross B. avatar
    21 posts
    Member since:
    Dec 2011

    Posted 22 Nov 2013 Link to this post

    Greetings,

    I am getting a few asp.net mvc 4 minification errors.

    I am using the following snippets in my bundling to allow minification while in release mode.

    bundles.IgnoreList.Clear();
    // FOR KENDO -Add back some of the default ignore list rules
    bundles.IgnoreList.Ignore("*.intellisense.js");
    bundles.IgnoreList.Ignore("*-vsdoc.js");
    bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
    if (!HttpContext.Current.IsDebuggingEnabled)
         BundleTable.EnableOptimizations = true;

    When I deploy to a staging server in release mode with the KendoUI version 2013.3.1119 I am receiving a handful of these listed below and my application fails to load:

    /* Minification failed. Returning unminified contents.
    (10,95812): run-time error CSS1030: Expected identifier, found '.'
    (10,95829): run-time error CSS1031: Expected selector, found ')'
    (10,95829): run-time error CSS1025: Expected comma or open brace, found ')'
    (10,95866): run-time error CSS1030: Expected identifier, found '.'
    (10,95883): run-time error CSS1031: Expected selector, found ')'
    (10,95883): run-time error CSS1025: Expected comma or open brace, found ')'
    (10,96027): run-time error CSS1030: Expected identifier, found '.'
    ...


  2. Ross B.
    Ross B. avatar
    21 posts
    Member since:
    Dec 2011

    Posted 24 Nov 2013 Link to this post

    It seems the minification is trying to minifying minified content as I only include the *-min.js files in the solution. The following is a workaround that works for me...

    Change:

    bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
    "~/Scripts/kendo/" +_KENDO_VERSION + "/kendo.all.min.js"
    , "~/Scripts/kendo/" +_KENDO_VERSION + "/cultures/kendo.culture.en-US.min.js"
    , "~/Scripts/kendo/" +_KENDO_VERSION + "/kendo.aspnetmvc.min.js"));

    To:
    bundles.Add(new Bundle("~/bundles/kendo").Include(
    "~/Scripts/kendo/" +_KENDO_VERSION + "/kendo.all.min.js"
    , "~/Scripts/kendo/" +_KENDO_VERSION + "/cultures/kendo.culture.en-US.min.js"
    , "~/Scripts/kendo/" +_KENDO_VERSION + "/kendo.aspnetmvc.min.js"));
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Logan
    Logan avatar
    32 posts
    Member since:
    Apr 2013

    Posted 25 Nov 2013 Link to this post

    I am seeing the same thing, and going from ScriptBundle to Bundle seems to have allowed it to work.  That said, that seems like a work around, not a fix and would feel more comfortable if we knew the cause of the problem.
  5. Supriya
    Supriya avatar
    6 posts
    Member since:
    Nov 2013

    Posted 25 Nov 2013 Link to this post

    I am experiencing this same issue when I upgraded my tookit to latest version. Did others who had this issue recently upgrade too?
  6. Supriya
    Supriya avatar
    6 posts
    Member since:
    Nov 2013

    Posted 25 Nov 2013 Link to this post

    Okie I think I figured out the root cause of the problem.
    Some of the kendo.js files may end with a

     //@ sourceMappingURL=.....

    The reason is that the start of the following file is appended to the "//@" line of jQuery, which means that it then becomes one long, extended comment.

    Removing these lines render the js files correctly. and then you can continue to use ScriptBundle which then minifies the minifications
  7. Ross B.
    Ross B. avatar
    21 posts
    Member since:
    Dec 2011

    Posted 25 Nov 2013 Link to this post

    Hey,

    I removed the comment from the kendo.all.min.js. I guess it was being pulled in via one of the culture script files.
  8. Logan
    Logan avatar
    32 posts
    Member since:
    Apr 2013

    Posted 25 Nov 2013 Link to this post

    The same minification error occurs with the CSS files in addition to the aforementioned .js files.

     I tracked down the cause of the error to these lines in kendo.common.min.css (copied and pasted here from the unminified version):

     

    :-moz-any(.km-view,.km-pane) {
      overflow: hidden;
    }
        .k-ff18 *:-moz-any(.km-view,.km-pane),
        .k-ff19 *:-moz-any(.km-view,.km-pane),
        .k-ff20 *:-moz-any(.km-view,.km-pane),
        .k-ff21 *:-moz-any(.km-view,.km-pane) {
          position: relative;
    }
    :-moz-any(.km-view) {
          display: -moz-inline-box;
          display: flex;
    }

     

    If you find those pieces in the minified .css file and comment them out, you no longer get the minification error.

     

    It’s unclear to me WHY this is occurring, but it appearsthat this section of CSS was added new in this latest version (.3.1119) and wasn’t present in the previous one I used (.2.918).

     

    I assume there is something similar going on with the .js files as well.

  9. Supriya
    Supriya avatar
    6 posts
    Member since:
    Nov 2013

    Posted 26 Nov 2013 Link to this post

    I had the 2013 Q2 version(2013.2.918) . I upgraded to 2013 Q3 version (2013.3.1119) and thats when these minification problems started.
    WHat I noticed is that both the //@ sourceMappingURL=.....  line added in .js files and the problem section in the css files are new to this version. I think that explains everything.
    The only solution to this is to add the bundles as new Bundle instead of new ScriptBundle or new StyleBundle. I think this is because when you add them as bundles it does not try to minify the files anymore.

    But I see that now they have released an updated internal build 2013.3.1122. This build fixes the .js file issues.
    However the minification of the css files continues to be a problem. so for now here is how I am bundling my files


    // The Kendo JavaScript bundle
    bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
    "~/Scripts/kendo.all.min.js", // or kendo.all.min.js if you want to use Kendo UI Web and Kendo UI DataViz
    "~/Scripts/kendo.aspnetmvc.min.js"));
     
    // The Kendo CSS bundle
    bundles.Add(new Bundle("~/Content/kendo").Include(
    "~/Content/kendo.common.min.css",
    "~/Content/kendo.dataviz.min.css",
    "~/Content/kendo.default.min.css"));
  10. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 26 Nov 2013 Link to this post

    Hi guys,

    Seems ASP.NET's MVC4 minification parser can't handle the non-standard :-moz-any() and :-webkit-any() selectors which are available in certain browsers for quite some time. I've just modified our CSS and the fix will be available with the next internal build.

    As a further clarification - the CSS in question has been in the mobile CSS for more than an year and was added to the web CSS in the latest release as a part of the adaptive rendering changes for the Grid and Scheduler.

    Regards,
    Kamen Bundev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  11. Chaitali
    Chaitali avatar
    5 posts
    Member since:
    Jan 2009

    Posted 03 Dec 2013 Link to this post

    Please let us know when the fix is available.

    Thanks
  12. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 03 Dec 2013 Link to this post

    Hi Chaitali,

    You should download the latest version of Kendo UI - 2013.3.1127, that contains the fix discussed in the current topic.

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  13. Jeff
    Jeff avatar
    27 posts
    Member since:
    Mar 2011

    Posted 03 Dec 2013 Link to this post

    Hi Kiril - I downloaded the 11/27 version, and the js script errors are gone, however the stylesheets still do not appear to be bundling correctly.   I'm not sure if the fix isn't in there, or if I applied the patch incorrectly.  Can someone confirm that the 11/27 build does fix the css bundling issue for them?  Thanks! 
  14. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 10 Dec 2013 Link to this post

    Hello Jeff,

    We tested the 1127+ CSS bundle and couldn't get the errors described above. Can you isolate the issue in a sample project and send it over in a new ticket? Thank you in advance.

    Regards,
    Kamen Bundev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  15. Jeff
    Jeff avatar
    27 posts
    Member since:
    Mar 2011

    Posted 17 Dec 2013 Link to this post

    Hi - I found the issue.  Using IIS Express, the minification works fine, but we are using the ASP.Net Development Server, and I was testing minificiation locally.   When I switch a working sample project from IIS Express to the ASP.Net Development Server, AND I have my bundle located in a "real" path location, such as "~/Content/kendo/2013.3.1213/css", I get a 404 error when retrieving the css bundle.   So it seems to be something with the way Cassini is resolving the minified bundle.  

    I'm not sure if this is a Kendo issue or a MS issue, but wanted you to let anyone else know what I found that may be encountering the same problem.

    Thanks,

    Jeff
  16. Alexander
    Alexander avatar
    19 posts
    Member since:
    Jun 2012

    Posted 22 Jul 2014 Link to this post

    I would like to add that I still see this problem when using .NET Bundling on Kendo UI Professional Q2 2014:

    /* Minification failed. Returning unminified contents.
    (29509,14): run-time error CSS1030: Expected identifier, found '.'
    (29509,21): run-time error CSS1031: Expected selector, found ')'
    (29509,21): run-time error CSS1025: Expected comma or open brace, found ')'
    */


    So the  :-moz-any() and :-webkit-any() selectors are still in kendo.default.mobile.css as of Q2 2014...

  17. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 28 Jul 2014 Link to this post

    Hi Alexander,

    We only removed :-moz-any() and :-webkit-any() from the web styles in Q3 2013 SP1 as MVC-based mobile apps are relatively uncommon and we needed at least :-webkit-any(). The web mobile themes were introduced in Q1 2014 and they indeed brought back several such CSS selectors. We will see what we can do to remove them. I'll write back here when a fixed internal build is available.

    Regards,
    Kamen Bundev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  18. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 28 Jul 2014 Link to this post

    Hello,

    The fix is now in, next internal build will feature it.

    Regards,
    Kamen Bundev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready