Chrome: fake.js file while debugging JavaScript

While debugging some JavaScript at work, the Chromium browser showed a file called fake_15289d233.js - instead of the real main.js file that was loaded by the HTML page.

fake.js file

Worse than the file name was the fact its source code did not change, even when I changed main.js.

In the end I found that main.js included a source map in the last line:

//#sourceMappingURL=data:application/json;base64,dead23beef42

That 'URL' contained the full original source of main.js and was shown instead of its content. After removing that line all was back to normal.

This particular source map was generated by browserify's, triggered via its debug setting.

Written by Christian Weiske.

Comments? Please send an e-mail.