Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery-2.0.0.min.map "Uncaught SyntaxError: Unexpected token :"

Tags:

jquery

nuget

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

like image 797
CrispinH Avatar asked May 05 '13 11:05

CrispinH


1 Answers

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.

like image 55
dherman Avatar answered Nov 09 '22 04:11

dherman