Chrome Dev Tools is warning of a missing Bootstrap source map in the OPAC: DevTools failed to load SourceMap: Could not load content for https://xxxxx/opac-tmpl/bootstrap/lib/bootstrap/js/bootstrap.bundle.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE (The xxxxx replaced the actual OPAC domain) I wouldn't have thought we would want to be referencing source maps in production, but I don't know if Bootstrap does that by default or whether we should be using a production build that doesn't reference it.
I think this is essentially a duplicate of Bug 26471. Several minified JS files in Koha include comments which are intended to point to source map files if they are available, for instance //# sourceMappingURL=bootstrap.bundle.min.js.map If you have the Chrome dev tools open, Chrome assumes you want it to look for this map to help you with JavaScript debugging. When it doesn't find one it tells you so. This isn't an error which has any consequence to the end user. I don't know why Chrome chooses to warn you about missing source maps and Firefox doesn't. The options for addressing the error: 1. Don't address the error. It only appears if you are inspecting the source in Chrome dev tools. 2. Modify each minified JavaScript file we get from third-party sources which include sourceMappingURL. 3. Build our own minified JavaScript files for each JS library and include the option to generate source maps. My vote is #1, and WONTFIX.
I'd add another option to that: 4. Build our own minified JavaScript files for Bootstrap and pass build options to not generate (and thus, not reference) source maps. The only reason the error is being generated is that the Bootstrap we're using has been built with source maps enabled and the path (as you mentioned, in the comment in the JS file) to the map in question is wrong, the file is there, it's just not accessible. It's a good job it's not accessible because it's 309K in size. As far as I can see, Bootstrap is the only library we're using that has been built with source maps. Anyway, as you say, it's not an issue, it's more of an annoyance to anyone who happens to be looking at the dev tools. So whether it's worth the effort of fixing is, IMHO, highly questionable!
I get bug 26471 on Firefox as well. I attached a patch there. Why not simply remove the line?
> The options for addressing the error: > > 1. Don't address the error. It only appears if you are inspecting the source > in Chrome dev tools. > > 2. Modify each minified JavaScript file we get from third-party sources > which include sourceMappingURL. > > 3. Build our own minified JavaScript files for each JS library and include > the option to generate source maps. > > My vote is #1, and WONTFIX. ... and Owen is (almost) always right. Closing this one, see explanation in comment #1