coffeescript icon indicating copy to clipboard operation
coffeescript copied to clipboard

Random parse errors with watcher?

Open contextlimit opened this issue 15 years ago • 1 comments

I'm editing my files via mounted SFTP drive, and the command-line watch auto-compiler randomly fails. There's nothing wrong with the syntax, and if I add a space, save, add a space, save, it works off and on. I suspect it's a latency issue?

Can you add a delay to compilation to compensate for network delay?

coffee -wc -o 3 3

16:31:24 GMT-0700 (PDT) - compiled 3/module/blog/init.coffee In 3/module/blog/init.coffee, Parse error on line 1: Unexpected '' 16:34:11 GMT-0700 (PDT) - compiled 3/test.coffee In 3/test.coffee, Parse error on line 1: Unexpected '' 16:34:13 GMT-0700 (PDT) - compiled 3/test.coffee 16:34:13 GMT-0700 (PDT) - compiled 3/test.coffee 16:35:18 GMT-0700 (PDT) - compiled 3/module/blog/init.coffee In 3/module/blog/init.coffee, Parse error on line 1: Unexpected '' 16:35:21 GMT-0700 (PDT) - compiled 3/module/blog/init.coffee 16:35:21 GMT-0700 (PDT) - compiled 3/module/blog/init.coffee

contextlimit avatar Mar 26 '11 23:03 contextlimit

I suspect there's a latency issue as well. We've heard reports of NFS mounted files not playing together nicely with the CoffeeScript watcher in the past. That said, I'm not sure it's justification for adding a built-in delay to the compiler. You might be better off with a general purpose watcher script for remote files that can invoke an arbitrary shell command after the appropriate delay.

jashkenas avatar Apr 27 '11 01:04 jashkenas