Reputation: 2069
Ever since I installed jQuery 1.9 and now 2.0 in an ASP.NET MVC4 project using Nuget in Visual Studio 2012, an additional .map file has been included in the scripts folder. I noticed in the console log that there is an error relating to jquery-2.0.0.min.map namely:
Uncaught SyntaxError: Unexpected token :
It's on line 1, but since this is a one line file that's to be expected.
I'd like to get rid of this error - do I actually need this .map file? Can I safely wave goodbye to it?
Crispin
Upvotes: 7
Views: 4766
Reputation: 93
If you want to keep the map file, you can just change the type
Instead of <script src="main.js"></script>
use <script src="main.js" type="application/json"></script>
Upvotes: 3
Reputation: 2892
You don't need the .min.map file for normal functionality. What the map file does is allow you to view the unminified version of the source code when you're loading the minified version, which is primarily useful in production.
http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ https://developers.google.com/chrome-developer-tools/docs/javascript-debugging#source-maps
It's perfectly safe to delete the file if you don't want it, it won't affect your code at all. The very worst case scenario is that you have Chrome Devtools open and see a 404 for the sourcemap file if you have sourcemaps enabled, but this won't happen for normal end users who don't have those dev tools open.
Upvotes: 5