Skip to main content

Search and Top Navigation

#9104 closed bug (invalid)

Opened February 19, 2013 11:49PM UTC

Closed March 08, 2013 08:55AM UTC

jquery ui 1.10.0 min license comments breaking mvc bundle

Reported by: jxmiller Owned by: jxmiller
Priority: minor Milestone: none
Component: [meta] ui.build Version: 1.10.0
Keywords: Cc:
Blocked by: Blocking:
Description

It appears to me that the license comments are breaking my mvc bundles. I can get into details if needed. Basically client uncaught exception unexpected token *. Removing the license comments makes the error go away. I get from NuGet if that matters.

This change also fixes my issue - change * to // at the beginning of each comment line:

/*! jQuery UI - v1.10.0 - 2013-01-17

http:jqueryui.com

Includes: jquery.ui.core.js, and bunch of other js files...

Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */

Thank you,

Attachments (0)
Change History (5)

Changed February 20, 2013 12:05AM UTC by jxmiller comment:1

Note: I just updated the MVC Bundle Transformer to the latest from NuGet, still no dice.

Since my initial comment above erradicated my example for the fix... I will try again.

/*

each new line must begin with instead of *

*/

I tried this as well outside of bundles referencing the file stand alone.

Changed February 20, 2013 04:15AM UTC by scottgonzalez comment:2

owner: → jxmiller
status: newpending

I don't know what an MVC bundle is, and it's not clear what you mean by breaking. Can you please provide more detail? Are you saying that .NET doesn't understand multi-line comments? I find this very hard to believe.

Changed February 21, 2013 01:20AM UTC by jxmiller comment:3

status: pendingnew

Replying to [comment:2 scott.gonzalez]:

I don't know what an MVC bundle is, and it's not clear what you mean by breaking. Can you please provide more detail? Are you saying that .NET doesn't understand multi-line comments? I find this very hard to believe.

TLDR; I will try to isolate and figure out exactly what is going on.

More detail anyways:

Microsoft MVC Framework has what is known as "Bundling" where in debug mode all js files in the bundle are separate script references - for debugging. When not in debug mode it will take the bundle (a collection of js files or css files) and minify/combine them. It will look for a .min version of a file and if it exists it will use that instead of their own minification, however the combining still occurs. With 1.10.0 I have no issue with the non .min version, but with the .min version I get "uncaught exception unexpected token '*'". and the line of code in dev tools shows me jqueryui.min as the culprit. Removing the licensing comments gets rid of the error. I do not want to alter the source code, in my mind that is a bad practice. I also certainly do not want to remove license information. So a solution I found is to replace the new line asterix with double slash.

Currently -
/* your license info...
* an additional line...
* an additional line...
* an additional line...*/
What works for me -
/* your license info...
// an additional line...
// an additional line...
// an additional line...*/

I hope that explains what I am experiencing. I do not expect that this has been observed elsewhere as I cannot find any similar instances, and I know lots of devs out there are using MVC framework etc. So I am leaning towards this being a personal problem, I just need to figure out a way to solve it... but I am stuck. If this is in relation to how MVC does its bundling and the fix I posted solves the problem... I would love to see MS fix it on their end, but I expect that to be similar to pulling teeth. This is my first real bug here, I love jquery. Please ignore this until I can find some time to figure out why this is occurring through perhaps some isolation.

One additional note I will mention is the difference in format between jquery.js and jqueryui.js files in regards to comments.

// Here we have essentially a single line, this is actually where I got the idea to replace the * with // even though... it shouldn't really matter.
/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery.min.map
*/

Changed February 21, 2013 01:40PM UTC by scottgonzalez comment:4

status: newpending

I pinged someone at Microsoft about this, we'll see what they say. I'm not sure why you'd want to include the minified file anyway if MVC is going to do its own minification. For core, I'm not sure if the sourceMappingURL is even going to be useful if it's concatenated with other files.

Changed March 08, 2013 08:55AM UTC by trac-o-bot comment:5

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!