Kevin Austin
Kevin Austin

Reputation: 184

jQuery Map 404 Issue in Rails App Console

In one of my Rails apps I have added a local jQuery library, but I have noticed a 404 in the console.

Should one be concerned about any future bugs due to not having the "jquery map" in my app files?

Problem: GET localhost:3000/assets/jquery-latest.min.map 404 (Not Found) Error

Thanks for any feedback in advance!

Upvotes: 0

Views: 62

Answers (1)

Max-P
Max-P

Reputation: 338

This is called a source-map file. You shoudn't worry about it, it is only loaded because the developer console of your browser is open and it attempts to automatically download the corresponding source map because jQuery provides one.

As you probably already noticed, you are using the compressed/minified version of jQuery and its code code is unreadable by a human. Source-map files allows the browser to run the minified version of the script but to also download the uncompressed version and a map file that links the two together. This way, when you are debugging your code the browser will present you the full source code of jQuery including the comments.

This may not be super useful alone with jQuery unless you develop jQuery, but if you compressed all of your Javascript files this is a neat feature: instead of having a crash in a function g(y,s,w,f), your browser would download the original source and tell you the error is in doSomething(element, width, height, otherThing) and basically act work like if the code was never compressed.

Upvotes: 1

Related Questions