Chrome isn't picking the source map, although it is enabled
Asked Answered
N

1

8

Chrome doesn't pick up the js source map and dumps the error from the original minified source. Source map clearly lays beside the minified js file, with the same name but a .map extension. And there is a proper reference to it at the end of minified js file:

//# sourceMappingURL=main.2635fcfe.js.map

Enable JavaScript source maps setting is also checked in the Dev Tools:

enter image description here

All the resources on the web state that it should just work. Any ideas on why it might not? Is there anyway to debug the source map inclusion process, maybe witness the path that Chrome is testing?

Nausea answered 8/2, 2019 at 8:45 Comment(8)
Does your JS file have the //# sourceMappingURL=/path/to/script.js.map comment? A sourcemap is not picked up just by lying next to the JS file.Keewatin
It does yes: //# sourceMappingURL=main.2635fcfe.js.mapNausea
Does it work in other browsers?Hiddenite
Dunno. Does this help?Keewatin
@Hiddenite works in Firefox.Nausea
@Keewatin nice resource!.. although it says that my source map is valid... sighNausea
Aaaand mysteriously after several dumb rebuilds and refreshes it now does...Nausea
See Also: Sourcemaps are detected in chrome but original source is not loadedVilhelmina
E
2

Edit:

Sharing my steps here:

  1. check Enable JavaScript source maps, doesn't work.
  2. I assume it may have something to do with my extensions? So I tried open a incognito window, works fine.
  3. go back to normal mode, works fine.

I had the same issue. Works fine on Firefox but not Chrome.

Got solved by open incognito window~

Endbrain answered 8/2, 2022 at 15:23 Comment(4)
This does not really answer the question. You won't expect your audience to always view your site in incognito window.Locke
@Henryc17 I'm just sharing my info and hope this can help. I have no idea why this work myself. Plus I use sourcemap in dev for debugging so there is no audience problems.Endbrain
It would be nice to hear that, your edit seems to be much clear and better now :) Sorry for the inconvenience taken to you if I did :)Locke
@Henryc17 Don't be. You helped me make this more clear, thx!Endbrain

© 2022 - 2024 — McMap. All rights reserved.