Get rid of missing source map errors (Failed to parse SourceMap)

Javascript

You might be receiving this notice in your browser console or some logs,

‘Failed to parse SourceMap: http…… ‘

Look inside the file for a line that looks like this.

//# sourceMappingURL=video.js.map

Now add a space, clear your caches and try loading the page again. The error should dissapear.

//# source MappingURL=video.js.map

This can be difficult to solve, an easy work around that is tested is provide below.

What this does is that the source map is no longer being downloaded so it will not be flagged as missing. Remove the space if you want to restore functionality.

http://superuser.com/questions/667325/how-do-i-disable-source-maps-in-safari

 

“A workaround for locally distributed vendor js files would be to edit them and modify the reference to the source map. For instance on backbone.min.js I’ve altered the line

//# sourceMappingURL=backbone-min.map

to

//# source MappingURL=backbone-min.map

…so that I can easily switch it back on again by removing the space. Obviously if you’re using a CDN version this isn’t going to work, but for development I’d recommend using local copies of vendor libs.”