During development of Lightning Web Components I have seen on multiple occasions an issue where the compiled source in the browser does not match the source deployed to the org, but instead matches an earlier version from that day's development.
The scenario is usually as follows.
On a scratch org that has not expired with debug mode enabled and persistent caching disabled:
- Deploy change A. Refresh browser, change A is shown.
- Deploy change B. Refresh browser, change B is shown.
- Deploy change C. Refresh browser, change C is shown.
- Deploy change X. Refresh browser, Browser shows source from change A.
- Deploy change X+1. Refresh browser, Browser shows source from change A.
- Deploy change X+2. Refresh browser, Browser shows source from change B (or possibly C).
Using another web browser does not fix the issue. The same (incorrect) version of the source is seen in both.
This is not something I ever experienced with Aura and it completely blocks development.
Is there something I can do to force a refresh or prevent this behaviour?