73

I've recently started having this problem with all my projects. When my index page loads which contains a reference to the jquery source file, my console logs this error: GET http://localhost:3000/js/lib/jquery-1.10.2.min.map 500 (Internal Server Error).

This doesn't affect my application at all, but it's really annoying to see whenever I open up the console. Does anyone know where this is coming from?

Edit: Note that I'm not explicitly referencing the .map file, I am just pointing to <script src="js/lib/jquery-1.10.2.min.js"></script>

user2066880
  • 4,825
  • 9
  • 38
  • 64

2 Answers2

112

jQuery recently started using source maps.

For example, let's look at the minified jQuery 2.0.3 file's first few lines.

/*! jQuery v2.0.3 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery.min.map
*/

Excerpt from Introduction to JavaScript Source Maps:

Have you ever found yourself wishing you could keep your client-side code readable and more importantly debuggable even after you've combined and minified it, without impacting performance? Well now you can through the magic of source maps.

Basically it's a way to map a combined/minified file back to an unbuilt state. When you build for production, along with minifying and combining your JavaScript files, you generate a source map which holds information about your original files. When you query a certain line and column number in your generated JavaScript you can do a lookup in the source map which returns the original location. Developer tools (currently WebKit nightly builds, Google Chrome, or Firefox 23+) can parse the source map automatically and make it appear as though you're running unminified and uncombined files.

emphasis mine

It's incredibly useful, and will only download if the user opens dev tools.

Solution

Remove the source mapping line, or do nothing. It isn't really a problem.


Side note: your server should return 404, not 500. It could point to a security problem if this happens in production.

Brigand
  • 84,529
  • 20
  • 165
  • 173
  • 4
    "... but arguable as to whether it should download for every user..." : Actually, source maps will only be downloaded by users that have their dev tools open and that have the "enable JS source maps" option enabled. – yop83 Oct 03 '13 at 15:23
  • 2
    In Safari browser, Failed to load resource: the server responded with a status of 404 (Not Found) (angular.min.js.map, line 0): causing issues. – Sinto Jul 30 '16 at 07:42
  • 1
    My question is why only in safari this issue is occurring? Other browsers doesn't show such problem. – Skaranjit Nov 07 '17 at 08:32
-13

I had similar expirience like yours. I have Denwer server. When I loaded my http://new.new local site without using via script src jquery.min.js file at index.php in Chrome I got error 500 jquery.min.map in console. I resolved this problem simply - I disabled extension Wunderlist in Chrome and voila - I never see this error more. Although, No, I found this error again - when Wunderlist have been on again. So, check your extensions and try to disable all of them or some of them or one by one. Good luck!