Ember CLI Live Reload Not Working
Asked Answered
C

4

11

I've seen other similar questions here and here but neither of those worked for me.

I'm on a mac and simply installed ember cli using npm and I thought it would work out of the box. Here is the server output:

version: 0.1.4
Could not find watchman, falling back to NodeWatcher for file system events
Livereload server on port 35729
Serving on http://0.0.0.0:4200/

Build successful - 2456ms.

Slowest Trees                  | Total          
-------------------------------+----------------
EsnextFilter                   | 877ms          
TreeMerger                     | 380ms          
Concat                         | 375ms          
JSHint - Tests                 | 178ms          
EsnextFilter                   | 146ms          
ES6Concatenator                | 135ms      
Candless answered 9/1, 2015 at 20:55 Comment(2)
are you on mac or linux? I got it worked for mac though.Flump
I'm on a mac - I'll update the question with that.Candless
C
24

I wasn't the only one with this issue and my friend found a solution that works.

Add the following lines to your .ember-cli in the root of your project:

"liveReload": true,
"watcher": "polling"

Once you restart the server, it should watch for changes to your directory.

Candless answered 15/1, 2015 at 0:9 Comment(2)
Prior to ember-cli v0.2.5, this would appear to have been the default. Since v0.2.5, I've had to set it manually.Adytum
I faced exactly similar issue for ember-cli 1.13.8. Just adding "watcher": "polling" also works.Flump
F
2

If you are on Mac then install watchman using brew install watchman instead of npm install watchman.

And if you are using Sublime Text then add below code to your sublime user settings json

Prefences -> Settings - User

{
"folder_exclude_patterns":
    [
        ".svn",
        ".git",
        ".hg",
        "CVS",
        "tmp/class-*",
        "tmp/es_*",
        "tmp/jshinter*",
        "tmp/replace_*",
        "tmp/static_compiler*",
        "tmp/template_compiler*",
        "tmp/tree_merger*",
        "tmp/coffee_script*",
        "tmp/concat-tmp*",
        "tmp/export_tree*",
        "tmp/sass_compiler*",
        "tmp/javascript",
        "tmp/result",
        "tmp/transpiled"
    ]
}

Exit Sublime once and open again. Right now Sublime has a bug which causes conflict with watchman, so above trick might work. Good luck.

Flump answered 9/1, 2015 at 21:9 Comment(2)
It still does not work. I made changes to both the application.js and application.hbs to see if it would catch either, but it didn't.Candless
No errors - it simply doesn't respond to any saved changes. When i startup the server, it does see Watchman now.Candless
C
1

Might be simplistic answer, but this was solution I needed
In Windows, run Node cmd in Administrator mode

Cathay answered 16/6, 2016 at 17:15 Comment(0)
O
1

Check package.json for the below devDependencies ,if not add it.

"ember-cli-inject-live-reload": "^1.3.1"
"ember-cli-styles-reloader": "0.1.8"

and in .ember-cli file add the below configuration,

"liveReload": true,
"host": "0.0.0.0"

(For me it works only after adding host entry).

Osanna answered 16/7, 2016 at 7:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.