| Summary: | Warning of missing Bootstrap source map | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Andrew Isherwood <bugzilla> |
| Component: | OPAC | Assignee: | Owen Leonard <oleonard> |
| Status: | CLOSED WONTFIX | QA Contact: | Testopia <testopia> |
| Severity: | trivial | ||
| Priority: | P5 - low | CC: | janet.mcgowan, jonathan.druart, oleonard |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
|
Description
Andrew Isherwood
2021-02-08 10:47:33 UTC
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 |