Quantcast
Channel: ajaxmin Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 683

Commented Issue: AjaxMinTask not working as expected [19459]

$
0
0
I am using AjaxMinTask and ajaxmin files from a .NET project in VS2010 to concatenate and compress both css and js files.

1. First problem is that the js code is broken once minified. I am using 14 files as input, JQuery, Knockout, YUI, etc., as well as my own code. One thing I am doing though is that I am using the already minified versions of the vendors' files listed above. Not sure if this is allowed but it would be handy (if not, why?). I have tried to use the following switches to no evail:

–global:YUI,JQuery,$,ko -evals:safeall -fnames:keep<

I am doing many Ajax calls and I wonder if this is not what gets broken (I saw there was a problem with that; not sure if it's been fixed).

2. Another problem is that the output files do not get overwritten with every build even though I use the "-clobber:true" switch. If not resolved, this problem would be definitely a show stopper (i.e. find another solution) as we do automatic builds on a build server and need to be sure the files will be renewed every time.

Thanks, Yves
Comments: ** Comment from web user: ronlo **

Okay, I found the unminified source code for jquery.validate 1.10. I don't see any issues at that point of the code, either in the unminified source, the minified source, or the AjaxMin results.

So you're saying you see the script error in your minified code, which contains the jquery.validate.min.js, _even when using the -minify:no switch_? I ran jquery.validate.min.js through AjaxMin -minify:no, saved the result, and diff'd it against the original. There's a three-character difference: in one place, AjaxMin adds a semicolon after a throw statement (which wouldn't cause a problem); and in another place it removes the quotes around an object literal property name of "boolean" (I don't _think_ that would cause any problems). Using jquery.validate.min.js and a version of that file run through AjaxMin with the -minify:no switch _shouldn't_ have any problems whatsoever -- the files are practically identical with the only deltas being insignificant. That file might be a red-herring, breaking there only because of some other issue up-stream.

You're combining a bunch of files together, right, so is it a _lot_ of code all on one single line, no? Could it be that the line is too long for your browser and its choking at some arbitrary point? I haven't run across that problem yet; the MSN homepage currently downloads a JS file containing a line that is 49,888 characters long, and we haven't had any issues. How many characters is your JS file's line? I see in one of your posts the error is only down in the 20K+ character position, so I'm really reaching with this idea. But if the length does turn out to be too long, you can always split it using the -line:N switch, which will break the lines at a convenient spot after it has become N characters long. So -line:500 would mean lines shouldn't be much longer than 500 characters each.

How about trying this, too (separately from the line-breaking): use the -line:M switch to output the result with line-breaks in it. That way when the script error occurs, it might be easier to see where it's happening (in addition to the -minify:no switch).

What happens if you use the unminified jquery.validate.js file in your source file list? Still repro the script error after running it through AjaxMin?

Unfortunately, I just haven't a clue where the problem might be without more information. The jquery.validate.min.js sources and the output of that file through AjaxMin with the -minify:no switch are identical for all practical purposes. If it doesn't fail before minification, but does after (which is what you're seeing), then I don't know where the issue could be. It must be in some other code, or in the order of the files in your package, or in one of the other files that's somehow affecting the validation code.


Viewing all articles
Browse latest Browse all 683

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>