This is a migrated thread and some comments may be shown as answers.

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

16 Answers 2772 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ross B.
Top achievements
Rank 1
Ross B. asked on 23 Nov 2013, 03:28 AM
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 '.'
...


16 Answers, 1 is accepted

Sort by
0
Ross B.
Top achievements
Rank 1
answered on 25 Nov 2013, 02:10 AM
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"));
0
Logan
Top achievements
Rank 1
Veteran
answered on 25 Nov 2013, 07:04 PM
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.
0
Supriya
Top achievements
Rank 1
answered on 25 Nov 2013, 07:33 PM
I am experiencing this same issue when I upgraded my tookit to latest version. Did others who had this issue recently upgrade too?
0
Supriya
Top achievements
Rank 1
answered on 25 Nov 2013, 08:14 PM
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
0
Ross B.
Top achievements
Rank 1
answered on 25 Nov 2013, 09:23 PM
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.
0
Logan
Top achievements
Rank 1
Veteran
answered on 25 Nov 2013, 09:27 PM
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.

0
Supriya
Top achievements
Rank 1
answered on 26 Nov 2013, 03:10 PM
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"));
0
Kamen Bundev
Telerik team
answered on 26 Nov 2013, 09:21 PM
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!
0
Chaitali
Top achievements
Rank 1
answered on 03 Dec 2013, 03:17 PM
Please let us know when the fix is available.

Thanks
0
Kiril Nikolov
Telerik team
answered on 03 Dec 2013, 03:21 PM
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!
0
Jeff
Top achievements
Rank 1
answered on 03 Dec 2013, 09:59 PM
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! 
0
Kamen Bundev
Telerik team
answered on 10 Dec 2013, 08:35 AM
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!
0
Jeff
Top achievements
Rank 1
answered on 17 Dec 2013, 03:20 PM
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
0
Alexander
Top achievements
Rank 1
answered on 22 Jul 2014, 12:48 PM
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...

0
Kamen Bundev
Telerik team
answered on 28 Jul 2014, 07:45 AM
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.

 
0
Kamen Bundev
Telerik team
answered on 28 Jul 2014, 08:32 AM
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.

 
Tags
General Discussions
Asked by
Ross B.
Top achievements
Rank 1
Answers by
Ross B.
Top achievements
Rank 1
Logan
Top achievements
Rank 1
Veteran
Supriya
Top achievements
Rank 1
Kamen Bundev
Telerik team
Chaitali
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Jeff
Top achievements
Rank 1
Alexander
Top achievements
Rank 1
Share this question
or