budo
budo copied to clipboard
occasional stale bundles
Some users have reported the occasional stale bundle on reload. Will have to investigate.
One thing that could be the culprit is the debounce in watchify-middleware. Might be better to use watchify's delay option.
In [email protected] the --version flag now displays more information about the browserify and watchify versions, which can also affect an issue like this. :smile:
e.g.
$ budo --version
budo v5.1.0
browserify v11.2.0
watchify v3.4.0
I added some tests to watchify-middleware to try and figure this out. Here's what I think is happening:
- user saves entry file
- before
chokidarhas a chance to catch the file change, the user hits Refresh on the browser - watchify-middleware sees no change, serves the old bundle
- then the
'pending'event is fired from chokidar, invalidating the bundle, but it's too late
I'm not sure a clean fix for this. It happens very rarely and probably only through manual reload (as opposed to --live reload). Maybe adding a slight delay to the requests would further minimize the chance of it happening.