Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap trying to load map file. How to disable it? Do I need to do it?

People also ask

Do you need .map files?

No, it doesn't. It just makes it more difficult to debug. You do not want this for production environment, so compile it accordingly ( gulp --production if you use gulp, this will not include that sourceMapping line) and exclude *. map files from your uploads to production server.

What are .map files for?

MAP file is for HTML image maps. An image map is formatted in HTML and creates click-able areas over a provided image. More generically, the . MAP extension can be used to denote any file type that indicates relative offsets from a starting point.

Where is bootstrap min js map?

BOOTSTRAP. MIN. JS. MAP: DOWNLOAD - CDNPKG.


Delete the line /*# sourceMappingURL=bootstrap.css.map */ from bootstrap.css


.map files allow a browser to download a full version of the minified JS. It is really for debugging purposes.

In effect, the .map missing isn't a problem. You only know it is missing, as the browser has had its Developer tools opened, detected a minified file and is just informing you that the JS debugging won't be as good as it could be.

This is why libraries like jQuery have the full, the minified and the map file too.

See this article for a full explanation of .map files:


Remove the line /*# sourceMappingURL=bootstrap.css.map */ in bootstrap.css

If the error persists, clean the cache of the browser (CTRL + F5).


This only happens when you use the dev-tools, and won't happen for normal users accessing the production server.

In any case, I found it useful to simply disable this behavior in the dev-tools: open the settings and uncheck the "Enable source maps" option.

There will no longer be an attempt to access map files.


Delete the line "/*# sourceMappingURL=bootstrap.min.css.map */ " in following files:

  • css/bootstrap.min.css
  • css/bootstrap.css

To fetch the file path in Linux use the command find / -name "\*bootstrap\*"


If you don't have the correct .map file and you don't want to edit lines in bootstrap.css you can create a dummy .map file.

In my case I was seeing the error:

GET /bootstrap.css.map not found.

So I created an empty bootstrap.css.map in the /public directory and the error stopped.


Delete /*# sourceMappingURL=bootstrap.min.css.map */ in css/bootstrap.min.css

and delete /*# sourceMappingURL=bootstrap.css.map */ in css/bootstrap.css