Skip to main content

Bad map file for jQuery 1.9.1 in the jQuery CDN

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.

Source:
Posted on by Dave Methvin
https://blog.jquery.com/2018/08/30/bad-map-file-for-jquery-1-9-1-in-the-jquery-cdn/

Comments

Popular posts from this blog

Facebook's Platform Update on Publish Permission

Over the past few months, we've continued to make significant changes to Facebook to better protect your information. This has meant working closely with developers to make sure they can adapt their apps to our new, tighter rules, while also continuing to offer people useful social experiences, like playing games or sharing playlists with friends. In a blog post on April 24, we announced that the publish_actions permission — which grants apps access to publish posts to Facebook as the logged in user — would be deprecated by August 1. Roughly 60,000 apps will lose access to the publish_actions permission on August 1, and we encourage developers to switch to Facebook's Share dialogs for web, iOS and Android. However, this timing does not give some desktop apps and hardware partners enough time to make the switch as they have very long product lifecycles. Therefore, we've granted 6-month and 12-month extensions respectively to these categories of developers. These developers...

Serialize and Deserialize JSON data with C#

This post is about example for serialize and deserialize json data with C#. This example using Newtonsoft.Json to be a library to work with json data. You can add Newtonsoft.Json by download from  https://www.newtonsoft.com/json  or using Nuget to add it into your project. In this example is Bill object that hold billing data about Car object. Serialize Object to String Below is example code to serialize object to json string. At line 39 is code to convert object into json string with beautiful json format. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; namespace JSON { class JSonExample { static void Main( string [] args) { List<Car> cars = new List<Car>(); float to...

jQuery 3.3.1 – fixed dependencies in release tag

We encountered an issue in the release for jQuery 3.3.0, so we’ve immediately released another tag. The code itself is identical, but our release dependencies (only used during release) were added to the dependencies of the jQuery package itself due to the new behavior of npm in version 5+. jQuery 3.3.1 is now recommended if installing from npm or GitHub. If using jQuery on any CDN, the built file only differs in the version number. We apologize for any inconvenience and have updated our release script to account for this issue. Please see the jQuery 3.3.0 blog post for all relevant code changes in this release. Download You can get the files from the jQuery CDN, or link to them directly: https://code.jquery.com/jquery-3.3.1.js https://code.jquery.com/jquery-3.3.1.min.js You can also get this release from npm: npm install jquery@3.3.1 Slim build Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests. A...