I use webpack as a module bundler
I have map files enabled
In chrome my original script files come from a special webpack resource
I'm not too sure what causes it but sometimes an old version of a script gets cached. The actual new code is still updating correctly but the version referenced by the map is out of date. This means line numbers don't match anymore and I cant see any code changes (eg super annoying).
It seems to eventually just fix itself but makes me sad in the meantime.
Has anyone else had similar issues/have any ideas of how to sort it out?
It seems to be isolated to chrome (if I go to another browser the correct version is loaded)
I have tried:
The problem is that Chrome needs to have must-revalidate in the Cache-Control` header in order to re-check files to see if they need to be re-fetched. This tells Chrome to check with the server, and see if there is a newer file. If there is a newer file, it will receive it in the response.
I worked out that this was caused by the actual map file being cached.
If you open the map file in a new tab and hard reload it, the source is all updated correctly
Its probably a bug in chrome that this is not reloaded with the dev tools disable cache setting or the pages hard reload.
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