6

I started my first project with ember cli and I noticed that the live reload isn't working. When I start the development server, I get multiple error messages (see below). Changes to the code base are only available after a restart of the server.

$ ember server
version: 0.1.2
Livereload server on port 35729
Serving on http://0.0.0.0:4200/
2014-12-03 17:51 ember[16491] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
2014-12-03 17:51 ember[16491] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
...
2014-12-03 17:51 ember[16491] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
2014-12-03 17:51 ember[16491] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)

Build successful - 1180ms.

Slowest Trees                  | Total          
-------------------------------+----------------
Concat                         | 368ms          
ES6Concatenator                | 150ms          
ES3SafeFilter                  | 149ms          
JSHint - App                   | 104ms          
JSHint - Tests                 | 80ms

At this stage I have the following packages/addons installed:

 DEBUG: -------------------------------
 DEBUG: Ember      : 1.7.0
 DEBUG: Ember Data : 1.0.0-beta.10
 DEBUG: EmberFire  : 1.3.1
 DEBUG: Handlebars : 1.3.0
 DEBUG: jQuery     : 1.11.1
 DEBUG: -------------------------------

Any idea what could cause this issue? It is quite annoying to restart the server for every change. Thank you for your suggestions.

neurix
  • 4,126
  • 6
  • 46
  • 71
  • Is this on windows 7/8 or OSX or linux? What if you upgrade to ember-cli 0.1.3 and try this again? – Toran Billups Dec 04 '14 at 04:32
  • have you tried rebooting? sometimes my live reload likes to stop functioning – tr3online Dec 04 '14 at 05:06
  • I am running ember-cli on OSX. I get the same error with 0.1.3. – neurix Dec 04 '14 at 05:08
  • It seems that the errors were generated by a corrupted js file in the browser cache. By coincident, I deleted the whole browser cache and the live reload works again. – neurix Dec 05 '14 at 05:17
  • Are you using Sublime? If so adding "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "tmp/*"] to User Settings may help – David Douglas Feb 20 '15 at 15:47
  • @neurix is this still relevant? both `0.2.x` and `1.13.x` seem to be working for me. – locks Jul 09 '15 at 05:14
  • @locks Thank you for checking in. The problem isn't relevant anymore. I think some file got corrupted (but after 7 months I am not sure anymore). – neurix Jul 09 '15 at 16:23

2 Answers2

4

The error is essentially caused by FSEvents watching too many files. If you're using Sublime Text, try excluding node_modules/, tmp/, and dist/ from your project (add them to the folder_exclude_patterns array in your Sublime user preferences).

If you're not using Sublime, or if doing so doesn't fix the issue, try upgrading your version of Node and version of ember-cli to the latest versions, as well as installing watchman using brew install watchman if you have Homebrew installed/are on OS X (as the latest versions of ember-cli no longer rely on FSEvents.

Source: https://github.com/ember-cli/ember-cli/issues/1260#issuecomment-67549158

Colby Ludwig
  • 78
  • 1
  • 7
  • Nice necro answer, I was really confused reading it was a new project with ember 1.7 there for a second after it popped into my feed. ;) – Kit Sunde Aug 20 '15 at 02:38
1

Add this parameters(liveReload and Watcher) to the file

/.ember-cli
and this will end with something like this:
{
  /**
    Ember CLI sends analytics information by default. The data is ...
  */

  "disableAnalytics": false,
  "liveReload": true,
  "watcher": "polling" 
}
/* Pooling, this is where the magic come, allow to edit file in the host and outside(EX: Virtual machines and servers relate) */