Skip to content

coffee --watch doesn't work reliably #2269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scribu opened this issue Apr 17, 2012 · 7 comments
Closed

coffee --watch doesn't work reliably #2269

scribu opened this issue Apr 17, 2012 · 7 comments
Labels

Comments

@scribu
Copy link

scribu commented Apr 17, 2012

When I call coffee -w -o js -c coffee/, or even for a single file, I have to save it at least two times to trigger a recompilation.

My environment: Ubuntu 11.10, node 0.6.15, CoffeeScript 1.3.1, vim editor

I've seen #1853, but figure a new issue is more appropriate, since I've read there were several changes in this area since then.

@scribu
Copy link
Author

scribu commented Apr 17, 2012

Also, sometimes, after a save, coffee says the file was removed, instead of recompiling it.

@TrevorBurnham
Copy link
Collaborator

@scottcorgan That sounds like a different issue than @scribu is experiencing. In particular, it's a bug at the Node.js level, which you should try to isolate and report. (Try updating Node to the latest 0.6.x release first.)

@TrevorBurnham
Copy link
Collaborator

@scribu This is most likely yet another quirk of Node's fs.watch. Try this: Launch the coffee REPL and run

> fs = require 'fs'
> fs.watch 'coffee/yourfile.coffee', -> console.log (+new Date), arguments

then tell me what output you get when you save changes to the file.

@scribu
Copy link
Author

scribu commented Apr 24, 2012

First file edit: nothing.
Second file edit:

1335280930608 { '0': 'change', '1': 'core.coffee' }
1335280930610 { '0': 'rename', '1': 'core.coffee' }
1335280930610 { '0': 'rename', '1': 'core.coffee' }

Subsequent edits: nothing.

@TrevorBurnham
Copy link
Collaborator

So it's definitely a bug in fs.watch, then. Please report it at https://github.com/joyent/node/issues/

By the way, as a workaround you can use https://github.com/trevorburnham/jitter, which uses the older and more reliable (though less efficient) fs.watchFile.

@michaelficarra
Copy link
Collaborator

@scribu: If you make a new node issue, post a link here.

@scribu
Copy link
Author

scribu commented Apr 24, 2012

Yep, Jitter seems to work fine. Thanks!

Opened an issue: nodejs/node-v0.x-archive#3172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants