1

I am getting the following error message in the Visual Studio 2013 debug window:

'iexplore.exe' (Script): Loaded http://localhost:4453/Scripts/lib/jquery-migrate.min.js

Unsupported format of the sourcemap

Module load messages are turned on (debug window context menu). I know that there should be a jquery-migrate.min.js.map file, but that is unfortunately not distributed by the jQuery team.

Now I tried to simply use an empty file, and also I tried to use the jquery.min.map file (simply renaming a copy to jquery-migrate.min.js.map), but both don't work.

I have also looked on the jQuery site, they provide a map file for Jquery but not for jquery-migrate: Download the map file for jQuery 2.1.4

Since the file is not available for download (or did I look at the wrong location), how can I create such a file from scratch? It seems to look like a JSON formatted file.

NOTE: There is some information available @ StackOverflow about site map files (see bootstrap-3-1-1-what-is-the-map-extension-file-used-for). And to give you an idea about the syntax of sourcemaps, you can read this: Source Map Revision 3 Proposal

Unfortunately, trying to mimick a sourcemap by using the information from the proposal did not help, the error message is still shown.

What I tried was creating a file jquery-migrate.min.js.map in the same path as the minified file jquery-migrate.min.js:

{"version":3, "file":"jquery-migrate.min.js", "sources":["jquery-migrate.js"], "names":["$"],"mappings":";EAAIzkC"}

(No idea how the mapping code is being calculated)

Unfortunately, this did not help.

Then I thought that it would suppress the error message by changing the file jquery-migrate.min.js in the following way:

I.e., I commented out the line

//@ sourceMappingURL=dist/jquery-migrate.min.map

so the file now looks like this (the code below is truncated for easier reading, just note the last line /*---disabled: //@ sourceMappingURL=dist/jquery-migrate.min.map ---*/):

/*! jQuery Migrate v1.1.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */ jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){o[n]||(o[n]=!0,e.migrateWarning....................

/---disabled: //@ sourceMappingURL=dist/jquery-migrate.min.map ---/

But the error message still occurred. Astro gave me the right hint (see his answer). Thank you!


NOTE (to the reviewers who changed the message above): This is an error message thrown by Visual Studio and the link is a local link which points to my IISExpress. Don't change the error message.

Community
  • 1
  • 1
Matt
  • 25,467
  • 18
  • 120
  • 187

1 Answers1

2

The jquery-migrate.min.js.map is there so you can debug the jquery minified library. It needs to be there for development purpose but for production you don't need that whole line. I dont know why they have included that line in the js.

You can just safely delete that whole line.

I dont know about VS2013 but for my php projects i run a gulp task on the file jquery.js to remove this line before concatenating with other js libraries,

astroanu
  • 3,901
  • 2
  • 36
  • 50
  • Yes, the same is achieved by creating bundles in ASP.NET/MVC with Visual Studio. That will concatenate and minify the files for reducing the amount of bytes and the number of streams when loading the code. – Matt Jun 19 '15 at 12:08
  • oh then you can write a task there to remove it on build ! – astroanu Jun 19 '15 at 12:10
  • 1
    Actually, that is done when you switch to "Release" and build the solution. The issue occurs in "Debug" mode, because there VS does not touch the files so you can debug the code more easily. Ideally, if VS could distinguish between .min.js and .js it could grab the unminified files for debugging and the minified files for the release. – Matt Jun 19 '15 at 12:13