browserify / watchify

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

Update only firing every 2nd change #238

Closed josh18 closed 9 years ago

josh18 commented 9 years ago

For some reason watchify only seems to be firing every second change. I assume this is something in my environment but I have no idea what it is that could be doing it.

Doesn't seem to matter how long there is in between saves it still will only run every second save. I closed all my applications except my text editor and terminal and it was still happening.

package.json

{
  "devDependencies": {
    "browserify": "^10.2.4",
    "reactify": "^1.0.0",
    "watchify": "^3.2.3"
  },
  "browserify": {
    "transform": ["reactify"]
  },
  "scripts": {
    "watch": "watchify src/test.js -o dist/test.js"
  }
}

test.js

var test = 1;

Details

System: OS X 10.7.5 (unfortunately)
Editor: Sublime Text 3 and also tried TextEdit

Let me know if you need any more information or you have any suggestions that I should try.

zertosh commented 9 years ago

You should look through the issues. Have you tried using polling?

josh18 commented 9 years ago

I've searched through the issues but can't find anything similar. Tried polling as well but same thing unfortunately.

Just tried on a different computer now and it works fine so definitely something with my environment. Is it possible that it is just OS X 10.7.5?

zertosh commented 9 years ago

that's kinda old. maybe? I have no way of testing. watchify uses chokidar as the watcher lib, maybe there is more info on older OS X versions there.

josh18 commented 9 years ago

Hmmm just searched through the chokidar issues and can't find anything. I'll close this as it's definitely something with my environment.

I'll try a couple different things and report back if I manage to fix it. It's just weird that it requires two saves every time without exception. I can save it twice in a row and I can save it once and then wait 5 minutes and save it again and it will work but will never work on the first save.

Thanks for your help.

josh18 commented 9 years ago

Ok I found what the issue was. The grandparent folder had an exclamation mark (!) at the start of it's name which was somehow messing it up. If the exclamation mark is in the middle it seems to be ok.

I'm assuming this is a bug with chokidar, do you think it's worth making an issue? (When I get a chance I also need to confirm that it's not just happening in OS X 10.7.5)

zertosh commented 9 years ago

@josh18 It could be a problem with chokidar's anymatch. It might be interpreting it as a negation glob.