DevTools failed to load source map. Below is the complete error message:
DevTools failed to load source map: Could not load content for http://192.168.10.12/admin/css/bootstrap.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
As a developer, I expect console output to only contain messages relevant to my application development.
How to fix DevTools failed to load source map error
It was frustrating to see the above error because I had no reference to the file bootstrap.min.js.map in my webpage which was indicated in the warning message. I searched the whole website’s root directory for the file and only found bootstrap.min.js and not bootstrap.min.js.map file. Surprisingly found a reference in the file bootstrap.min.js for bootstrap.min.js.map as below:
As it is commented didn’t pay much attention to it!
What is a SourceMap?
Simply remove the below line from the file or based on the bootstrap version, you can download the corresponding source map file and place it in the appropriate directory where bootstrap.min.js is placed.
Similarly, if you found a warning corresponding to a missing source map file, either go to the corresponding file and remove the
sourceMappingURL line or download the corresponding source map file and place it in the appropriate directory.