browserify / watchify

watch mode for browserify builds
Other
1.79k stars 181 forks source link

Watchify index.js invalidate function never pass on Mac #263

Closed 66eli77 closed 9 years ago

66eli77 commented 9 years ago

OS: Mac 10.10.3 watchify: 3.3.1 node.js: 0.12.7 The build process only happened once and after that, any change to my JS file cannot trigger the rebuild. I track down the issue in Watchify's index.js file. Where between line 97 - 104

b.on('bundle', function (bundle) {
        updating = true;
        bundle.on('error', onend);
        bundle.on('end', onend);
        function onend () { updating = false }
    });

The first time build process sets "updating = true" and bundle.on('end', onend) never fired. Therefore, "updating" is always True, making the invalidate function early return: line 129 - 133

function invalidate (id) {
        if (cache) delete cache[id];
        if (pkgcache) delete pkgcache[id];
        changingDeps[id] = true;
        if (updating) return;
66eli77 commented 9 years ago

OK, the issue is resolved by updating the browserify version from 10.2.4 to 11.0.1. It turns out the older version of browserify is incompatible with the new watchify ...

zertosh commented 9 years ago

Yeah, see https://github.com/substack/watchify/pull/250#issuecomment-126404248 and https://github.com/substack/watchify/issues/256#issuecomment-130261185, sorry