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

Since I installed jQuery 1.9 and now 2.0 in an ASP.NET MVC4 project using Nuget in Visual Studio 2012, an extra .map file has been added to the script file. I noticed in the console log an error related to jquery-2.0.0.min.map, namely:

Uncaught SyntaxError: Unexpected token : 

This is on line 1, but since it is a single line file, one would expect.

I want to get rid of this error - do I really need this .map file? Can I calmly say goodbye to him?

Crispin

+6
source share
2 answers

You do not need a .min.map file for normal operation. What the map file does is it allows you to view the unexecuted version of the source code when downloading the mini version, which is primarily useful in the production process.

http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/ https://developers.google.com/chrome-developer-tools/docs/javascript-debugging#source-maps

It is completely safe to delete a file, if you do not want it, it will not affect your code at all. The worst-case scenario is opening Chrome Devtools and viewing the 404 source file if you have source maps, but this will not happen for regular end users who do not have these developer tools.

+5
source

If you want to save the map file, you can simply change the type

Instead of <script src="main.js"></script> use <script src="main.js" type="application/json"></script>

+2
source

Source: https://habr.com/ru/post/944309/


All Articles