4

I generate source maps for javascript files during minification. The map files are referenced using a relative URL from the minified JS files that sit next to the map files. Here is an example comment at the end of app-e47a6637.js:

//# sourceMappingURL=app-e47a6637.js.map

The source map resolution works as expected in Firefox. However, Chrome does not load the map files.

Additional information:

  • JS source maps are of course enabled in the settings.
  • I tried putting a proxy between Chrome and the server. Chrome does not even request the map files.
  • I use gulp-sourcemaps to generate the map files.
  • I don't want to use the workspace feature of Chrome. I just want it to display the original source files.

How can I enable source maps in Chrome?

8
  • Are your sourcemaps being served? ( can you view them if you point your browser directly at them? ) Another thing you might try is an 'empty cache and hard reload' I've noticed chrome seems to cache source stuff pretty deep. Commented Dec 7, 2015 at 16:57
  • @BenJamin Yes they are, otherwise it wouldn't work in Firefox. I can download the map files in both FF and Chrome. Clearing the cache also did not improve the situation. Commented Dec 8, 2015 at 7:21
  • is the Source Map URL correct? Commented Dec 8, 2015 at 21:53
  • @BenJamin I don't know if you saw my comment: "... otherwise it wouldn't work in Firefox. I can download the map files in both FF and Chrome." So yes, the URL is correct. Commented Dec 9, 2015 at 8:13
  • In the web inspector, under settings, is "Enable JavaScript source maps" checked? Commented Dec 9, 2015 at 8:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.