1

We are running a Gulp task inside of Visual Studio (2015) to execute watchify. Works great some of the time, but sometimes watchify builds old code.

Repro:

  • Modify a .ts file in Visual Studio
  • Save
  • In the Task Runner Explorer, watch for watchify output, indicating that it ran (it does)
  • Refresh Chrome/clear cache (I use the "disable caching while debug window is open" option in Chrome)
  • View source in the Chrome Debugger (a little less than half the time, it will be the old code)

Any idea what I need to look for? Note that if I execute a full browserify build, Chrome always sees the new code -- this staleness problem only happens when Watchify is in the mix.

cartant
  • 57,105
  • 17
  • 163
  • 197
JMarsch
  • 21,484
  • 15
  • 77
  • 125
  • When you next have stale code in the browser, you should check to see whether the on-disk bundle contains stale code. If the code within it isn't stale, it's not a watchify problem. – cartant Apr 26 '17 at 06:48
  • It's not stale code in the browser -- I'm making sure to clear the cache or disable caching. – JMarsch Apr 26 '17 at 16:16
  • It's possible to enable a substantial amount of logging within tsify [using the `NODE_DEBUG` environment variable](https://github.com/TypeStrong/tsify/blob/master/CONTRIBUTING.md#debugging). Looking for differences in logged output between builds in which it works and does not works is likely the best (only?) approach. – cartant Apr 26 '17 at 20:25
  • 1
    I can try that. To be honest, I'm not sure whether this is a tsify problem or a watchify problem (tsify seems to work fine if I invoke "full build" by executing browserify. I think that seems to indicate watchify as the problem. – JMarsch Apr 27 '17 at 14:46
  • Seems like it is related to https://stackoverflow.com/questions/44788166/browserify-watchify-compile-old-ressource-on-localhost-with-vuecomponent – Aleksandr Apr 09 '18 at 11:28

0 Answers0