Bad map file for jQuery 1.9.1 in the jQuery CDN

Posted on by

Quite a while back, Mike Taylor pointed out that the jQuery CDN has a minified copy of jQuery 1.9.1 with an incorrect map file reference. Basically, it refers to the map for jQuery 1.11.1, and that’s just wrong. If you are trying to debug a site that uses the minified jQuery 1.9.1 file, dev tools will get very confused and make a hard job even harder.

You might think that we could just edit the https://code.jquery.com/jquery-1.9.1.min.js file to point to the correct map file, which does exist as https://code.jquery.com/jquery-1.9.1.min.map. There are at least two problems with doing that. The first is that the file is heavily cached across the internet, since it’s been assumed for years that it will never change once the release occurs. Even if we edited the file, both the JavaScript and map file might never actually update at the point where they’re being used.

A second problem is even more serious. We’ve been advocating that developers use the script’s integrity attribute to ensure that the file you are including has not been modified since you originally wrote the script tag. If we modify the contents of the file this attribute will be wrong and the page will no longer include the file. This is likely to completely break the page! Given the age of jQuery 1.9.1 it is possible that many of the pages including this file are not being actively maintained. Thus, we can’t seriously consider changing the JavaScript file in any way, not even one byte.

The least disruptive option is to remove the jquery.min.map file that the jQuery 1.9.1 minified file references. It does not affect whether jQuery runs correctly for the visitors of a site. It only has the effect of disabling the source map. Because of these pitfalls of including the sourceMappingURL map reference in CDN JavaScript files that are often copied elsewhere, we no longer include it.

If you need to debug a site using one of these minified files, it is possible to manually associate a map file in Chrome. Open the minified source file, right click over the area of the minified source, and select “Add source map…”.

The incorrect jquery.min.map file has been removed from the jQuery CDN. We expect that there won’t be any observable change from removing this file, other than restoring sanity to debugging a site that uses jQuery 1.9.1. The jQuery 1.11.1 minified file does not reference its map, so it will continue to work fine and you can associate a map file as mentioned above.

Because caches are so aggressive on CDNs and across the internet, it’s possible that you may still see this map file for a while. If you see some unusual behavior that you think is related to the missing jquery.min.map file you can open a ticket on the CDN issue tracker.

37 thoughts on “Bad map file for jQuery 1.9.1 in the jQuery CDN

  1. cheong on said:

    I wonder if it’d be a good idea to use bump the version to 1.9.2. People who feel no map file is okay can still use 1.9.1 as they want, and people who need map file support in their IDE can get their map file.

  2. Wonderful goods from you, man. I have understand your stuff previous to and you are just too
    fantastic. I actually like what you have acquired here, really like what
    you’re stating and the way in which you say it. You make it
    entertaining and you still take care of to keep it sensible.
    I can’t wait to read far more from you. This is actually a wonderful site. https://soikeoplus.com/tag/soi-keo-nha-cai

  3. Very good write-up. I certainly love this website. Thanks! GarageBand For PC comprises lots of synthesizers and tool emulators letting you create sounds which are indistinguishable to many different authentic world tools.

  4. I ?on’t know if it’s just me or if everyone else
    encountering issues w?th your site. It looks like s?me of thee
    written text in your posts are running off the screen. Caan somjebody else pleae provide f?edback and let me know if this is happening
    to themm too? This mig?t be ? problem with my browser because I’ve
    ha? th?s happen before. Thank? you http://www.51mmgg.com/comment/html/?234442.html

Leave a Reply

Your email address will not be published. Required fields are marked *