I am on Chrome Dev 27, and in the Dev Tools settings checked Disable cache. When I reload a page, Chrome properly reloads all the resources used by map page, including the .js
files. However, it doesn't automatically reload the corresponding source maps .map
. Monitoring the HTTP traffic between Chrome my app, on subsequent page load, I don't see any request from Chrome for the .map
files. How can I get Chrome to also reload the source maps?
The issue with Chrome not reloading the .map
file is that it also won't reload the file from which the .js
was generated, which in my case happens to be a CoffeeScript file (.coffee
), which means that when debugging, in the Sources tab I am looking at an old version of the .coffee
file, even if the new code (from the .js
) is running.
Browser support To enable source maps in Google Chrome, go to Developer Tools, click the little cog icon, and then make sure that “Enable Javascript source maps” is checked. That's it.
The main purpose of sourcemaps is to aid debugging. Basically, if there's an error in the generated code file, the map can tell you the original source file location. That's it. It's pretty powerful in practice! Both Chrome and Firefox currently support the processing of sourcemaps in the developer tools.
A source map is a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger.
I had this same issue just today. The wait to solve it for me was to close the coffee file's tab under sources, go to the network tab, right click, and select "Clear Browser Cache"
This fixed it for me.
That said, the mapped files don't always get "stuck" in cache for me... Only sometimes, and when they do, the clear cache trick fixes it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With