Moving toward a healthy Brunch

So I've gotten brunch installed on Windows (hard) and Linux (easy) and starting to use it.

One of the things that I wanted to do was to use jade as my templating language rather than the default handlebars. This led to a problem that pre-existed, but which I had not detected. When I made changes I got this error message:


09 May 10:35:11 - info: application started on http://localhost:3333/
09 May 10:35:12 - info: compiled.

C:\Users\mwolf\AppData\Roaming\npm\node_modules\brunch\lib\logger.js:44
      return this.log.apply(this, ['error'].concat(__slice.call(arguments)));
                      ^
TypeError: Cannot call method 'apply' of undefined
    at FSWatcher.<anonymous> (C:\Users\mwolf\AppData\Roaming\npm\node_modules\brunch\lib\logger.js:44:23)
    at FSWatcher.<anonymous> (events.js:67:17)
    at FSWatcher.emit (C:\Users\mwolf\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\watch.js:159:32)
    at C:\Users\mwolf\AppData\Roaming\npm\node_modules\brunch\lib\fs_utils\watch.js:131:24
    at Object.oncomplete (fs.js:816:23)



Yuck. I went to github and found an issue posted here that solved the problem quite nicely:

IntelliJ IDEA (and probably Webstorm, although I haven't tried it) seem to write out temporary files called things likemy.coffee__jb_bak__ and then delete them again an instant later; I guess its probably something to do with the internal coffeescript compiler. 
The effect of this is the the Brunch watcher picks the files up then tries to compile them by which time they have been deleted by IDEA.

A
 very simple workaround is to add files ending in __ to the ignored list in common.js by changing
ignoredRe = /^(\.|#)/;
to
ignoredRe = /(^(\.|#)|__$)/;
After this everything works perfectly.


ignoredRe = /^(\.|#)/;
to
ignoredRe = /(^(\.|#)|__$)/;
After this everything works perfectly.


Comments

Popular Posts