SquishIt ForceRelease in MVC3 doesn't minify JQuery plugins correctly

I am getting tons of errors when using SquishIt in my MVC3 app with 3rd party JQuery plugins. On my development machine, if I set the ForceDebug method in the Bundle command, everything works fine and the JS is processed as usual. However, if I set the ForceRelease method (before testing before going to production) when I host the site, FireFox displays "not a function" errors. I tried setting compilation debug="true"

in web.config with no improvement.

Here are the JS calls in my _layout.cshtml file. All packages for standard jQuery plugins:

<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.min.js"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui-1.8.18.custom.min.js")"></script>


Here is an example of errors displayed by FireFox. It depends on what I included in the kit:

function (n) {var i = (n.browser.msie ? "paste" : "input") + ".mask", t = window.orientation != undefined;n.mask = {definitions: {9: "[0-9]", a: "[A-Za-z]", '*': "[A-Za-z0-9]"}, dataName: "rawMaskFn"}, n.fn.extend({caret: function (n, t) {if (this.length != 0) {if (typeof n == "number") {return t = typeof t == "number" ? t : n, this.each(function ()

... YADDA YADDA YADDA - 50 more lines of script here ... function () {setTimeout(i, 0);})();}).bind("blur.mask", function () {v(), c.val() != p && c.change();}).bind("keydown.mask", nt).bind("keypress.mask", d).bind(i, function () {setTimeout(function () {c.caret(v(true));}, 0);}), v();});}});}(jQuery) is not a function

$(".dropdown-checklist").dropdownchecklist is not a function

Any thoughts on what I might have screwed up here?


source to share

1 answer

We ran into something similar before ... found out that one of the files did not have a semicolon at the end of the javascript function. This caused all kinds of chaos. The function works great when it's a file on its own, but after combining it, the semicolon makes a difference.

You can also set Minifier to null Minifier and view the output it generates. This can help troubleshoot some issues.



All Articles