Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular.min.js.map not found, what is it exactly?

Tags:

angularjs

When I load the page and check chrome console i find these errors: enter image description here

what exactly are map files in angular?

I did reference the angular.min.js but not the angular.min.js.map. I am using the angular 1.2 rc release by the way and I just started seeing these errors when i switched to this release.

ERRORS:
GET http://localhost:44786/Scripts/angular-route.min.js.map 404 (Not Found)       :44786/Scripts/angular-route.min.js.map:1
GET http://localhost:44786/Scripts/angular-animate.min.js.map 404 (Not Found) :44786/Scripts/angular-animate.min.js.map:1
GET http://localhost:44786/Scripts/angular-resource.min.js.map 404 (Not Found) :44786/Scripts/angular-resource.min.js.map:1
GET http://localhost:44786/Scripts/angular.min.js.map 404 (Not Found) :44786/Scripts/angular.min.js.map:1
like image 524
raberana Avatar asked Aug 25 '13 04:08

raberana


2 Answers

As eaon21 and monkey said, source map files basically turn minified code into its unminified version for debugging.

You can find the .map files here. Just add them into the same directory as the minified js files and it'll stop complaining. The reason they get fetched is the

/*
//@ sourceMappingURL=angular.min.js.map
*/

at the end of angular.min.js. If you don't want to add the .map files you can remove those lines and it'll stop the fetch attempt, but if you plan on debugging it's always good to keep the source maps linked.

like image 151
Jussi Kosunen Avatar answered Oct 20 '22 02:10

Jussi Kosunen


Monkey is right, according to the link given by monkey

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.

I am not sure if it is angular's fault that no map files were generated. But you can turn off source map files by unchecking this option in chrome console setting

enter image description here

like image 108
raberana Avatar answered Oct 20 '22 00:10

raberana