MVC Bundling/Minification Failure for Kendo JS/CSS

2 posts, 1 answers
  1. Ed
    Ed avatar
    168 posts
    Member since:
    Sep 2013

    Posted 01 Oct 2014 Link to this post

    I am getting Minification failed errors when trying to bundle together Kendo CSS & JS (separately in ScriptBundle & StyleBundle).  Here is the bundle code from BundleConfig.cs:

    bundles.Add(new ScriptBundle("~/Scripts/kendo/responsive-kendojs")
                    .Include("~/Scripts/kendo/jquery.min.js")
                    .Include("~/Scripts/kendo/kendo.all.min.js")
                    .Include("~/Scripts/kendo/kendo.aspnetmvc.min.js"));

    and

    bundles.Add(new StyleBundle("~/Content/kendo/responsive-kendocss")
                    .Include("~/Content/kendo/kendo.common.min.css")
                    .Include("~/Content/kendo/kendo.common-bootstrap.min.css")
                    .Include("~/Content/kendo/kendo.bootstrap.min.css")
                    .Include("~/Content/kendo/kendo.mobile.all.min.css")
                    .Include("~/Content/kendo/kendo.dataviz.min.css")
                    .Include("~/Content/kendo/kendo.dataviz.bootstrap.min.css"));

    When I load my page, the bundles come across properly, but when I inspect the contents of the bundles, I see this content:

    for request:
    http://localhost:2952/Scripts/kendo/responsive-kendojs?v=xBcra9G7ySZaZKhcyL_pQa3jyJ0xPNrIODFoRbbwXqA1

    /* Minification failed. Returning unminified contents.
    (47,9295-9302): run-time error JS1019: Can't have 'break' outside of loop: break e
    (47,8578-8585): run-time error JS1019: Can't have 'break' outside of loop: break e
    */

    and

    for request:
    http://localhost:2952/Content/kendo/responsive-kendocss?v=95SMW4BbxMxlmxetk9pG-NULh83t6TL_m0-g32mfJzU1

    /* Minification failed. Returning unminified contents.
    (36,46845): run-time error CSS1030: Expected identifier, found '.'
    (36,46852): run-time error CSS1031: Expected selector, found ')'
    (36,46852): run-time error CSS1025: Expected comma or open brace, found ')'
    (36,59002): run-time error CSS1030: Expected identifier, found '.'
    (36,59010): run-time error CSS1031: Expected selector, found ')'
    (36,59010): run-time error CSS1025: Expected comma or open brace, found ')'
    (36,85507): run-time error CSS1030: Expected identifier, found '.'
    (36,85520): run-time error CSS1031: Expected selector, found ')'
    (36,85520): run-time error CSS1025: Expected comma or open brace, found ')'
    (36,100242): run-time error CSS1030: Expected identifier, found '.'
    (36,100250): run-time error CSS1031: Expected selector, found ')'
    (36,100250): run-time error CSS1025: Expected comma or open brace, found ')'
    (36,101745): run-time error CSS1030: Expected identifier, found '.'
    (36,101753): run-time error CSS1031: Expected selector, found ')'
    (36,101753): run-time error CSS1025: Expected comma or open brace, found ')'
    (36,101810): run-time error CSS1030: Expected identifier, found '.'
    (36,101818): run-time error CSS1031: Expected selector, found ')'
    (36,101818): run-time error CSS1025: Expected comma or open brace, found ')'
    (36,101911): run-time error CSS1030: Expected identifier, found '.'
    (36,101919): run-time error CSS1031: Expected selector, found ')'
    (36,101919): run-time error CSS1025: Expected comma or open brace, found ')'
    */

    I am currently using v2014.2.716 and VS2010 and MVC4.

    Please let me know if you need additional info.
    Thanks,
    --Ed
  2. Answer
    Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 03 Oct 2014 Link to this post

    Hello Ed,

    Thanks for the heads up. We'll investigate this issue and try to work around it.
    Note that having a break statement outside of a loop is valid JavaScript. It's just that the ASP.NET minification doesn't like it.

    My suggestion is to leave it as is, as excluding kendo.web.js requires ordering the scripts manually.

    My apologies for the inconvenience.

    Kind Regards,
    Petur Subev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top