Search code examples
ember.jsreloadember-cli

Ember-cli: Live reload not working


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.


Solution

  • 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