Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 756
neurix Avatar asked Dec 04 '14 02:12

neurix


2 Answers

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

like image 160
Colby Ludwig Avatar answered Sep 22 '22 16:09

Colby Ludwig


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) */
like image 28
Garibaldy Cramer Avatar answered Sep 19 '22 16:09

Garibaldy Cramer