I can't seem to get my browsers to automatically reload and I'm having trouble working out how to troublshoot it as I don't get any errors.

When I run drush omega-guard it all starts fine with thw following output

13:48:51 - INFO - Guard::Compass is waiting to compile your stylesheets.
13:48:51 - INFO - LiveReload is waiting for a browser to connect.
13:48:51 - INFO - Guard::Compass is waiting to compile your stylesheets.
13:48:51 - INFO - Guard is now watching at '/var/www/websites/sites/all/themes/first_omega_subtheme'

When I change a Sass file compass auto re-compiles and I get this output in the terminal
unchanged sass/reset.scss
unchanged sass/hacks.scss
overwrite css/styles.css
unchanged sass/reset.scss
unchanged sass/hacks.scss
unchanged sass/styles.scss
13:36:50 - INFO - Reloading browser: css/styles.css

But my browser chromium or firefox doesn't auto reload.

When I hit refresh I can see the changes reflected in the browser and I see this in the terminal window

[1] guard(main)> 13:50:31 - INFO - Browser disconnected.
13:50:31 - INFO - Browser connected.

Any help would be appreciated

Cheers Dan

Comments

fubhy’s picture

Status: Active » Fixed

This looks suspicious.

[1] guard(main)> 13:50:31 - INFO - Browser disconnected.
13:50:31 - INFO - Browser connected.

Why is the browser connecting and then disconnecting right away? It should just read "Browser connected". Do you have any firewalls that might block the livereload ports? Try a different port. Also, try to use "bundle exec guard" in the theme directly without going through the drush command. If that doesn't help, please consult stackoverflow or livereload.com for help regarding livereload as it then wouldn't really be omega related. Also try using telnet to connect to the livereload port. Maybe that will give you some clues.

Oh, and make sure that you are NOT running any livereload browser extensions. We are using the livereload-js solution (doesn't require any livereload browser extensions). In fact, the livereload browser extension might interfere.

fubhy’s picture

Oh, are you really on 4.x-dev? If that's the case, make sure that the livereload.js library is loaded as it is no longer part of the Omega download (due to licensing issues). You have to either download it manually and place it in the right path (THEME/components/livereload-js/livereload.js or something like that) or use bower (@see bower.json). This is new since a few days (does not affect beta-6, that version still ships with the .js file included).

danharper’s picture

Version: 7.x-4.x-dev » 7.x-4.0-beta6

I'm using beta6 so livereload is a setting in the theme, I don't have a firewall turned on and I can connect to that port successfully using telnet. I can access the the js file from this location http://localhost:35729/livereload.js when Guard is running but not when it is not running.

It's not an Omega problem just thought here would be the best place for help, and I may have being doing something obviously wrong.

Dan

fubhy’s picture

Hmm, no, sounds like you are doing everything right.

I'm using beta6 so livereload is a setting in the theme,

Yes, even with 4.x-dev it's still a setting in the theme. Just the .js file does not ship directly with omega anymore. You can, however, install it by simply running "bower install" in your subtheme. Easy.

No idea what's causing your problem though :/

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

c8n’s picture

Status: Active » Closed (fixed)

Same issue here with latest omega dev and own subtheme created via drush wizard.

And the recommendation bower install doesn't install livereload. Finally. But it took me half a day to find the problem, why bower won't install correctly in the first place and after I have installed it now finally to use it here for the recommended solution, I have to find out that it didn't install livereload. I can't find any docs explaing WHERE exactly livereload has to be placed and WHAT the setting in the template exactly should be. Since many of the here mentioned solutions require many dependencies (bower < npm < nodejs, aso.) , I finally run into more than half a day installing nodejs, npm, guard, guard-livereload, bower, sass, compass, rvm and so on, and so on ... all with its own installing issues of course. How much do I need to work on a websites stylesheets the recommended way from a the contributor/developer? Didn't it become a little bit absurd? Don't get me wrong. It isn't meant respectless against the awesome contribution, but ...

Intuitively a user would think the path in the theme settings should reflect the path in the file structure of his server enviroment. So ..., first he will wonder why the path in the theme settings say: http://localhost:port/livereload.js - Why? Because, he will look in the root of his webserver which is usually /usr/var/www and will find out: there is no livereload.js - Than he will try to use the domain where his template is used but with no success and will try to find infos here and on livereload js about it but will land into a jungle of use cases, plug ins, additional add ons and installing options without any idea what depends on his issue.

Finally he will turn off the livereload feature and will go back to normal refresh methods after spending a day with it ...

You have to either download it manually and place it in the right path (THEME/components/livereload-js/livereload.js or something like that)

yeah, something like that seems to be the important something, which is still missing (something like that seems to be a little bit unspecific, isn't it?)... downloading the master.zip from livereload only let me stuck on a extracted root where livereload.js lies in a dist folder, so where to put it at now? no answer in the web ...

Sorry don't get me wrong. As fas as I can see in the short time being here you did an awesome contribution with omega 3 and 4 and you are a very nice and helpful person in many threads with long explanations to help the frustrated user, but somehow I always feel like that one little important info is always missing to find the solution to a small exisitng problem ... And somehow I always get the feeling to loose live time by learning things which are of no need 3 years later no more. All I want ist, to use a feature which is promoted with the template settings and it always seems like being closebefore but then it hides on the horizon ...

still like in the start post: no browser refresh, but in terminal all looks fine ...

c8n’s picture

Status: Closed (fixed) » Active
c8n’s picture

Status: Closed (fixed) » Closed (duplicate)

I close this in favour of this one #2108005: livereload settings do not append hostname to uri, which seems to be more fresh and with the accurate settings mirrored, which I worry about. Sorry for my long frustrated text before, but ... yeah you know ... always the same ... wasted life time for troubelshooting of trouble you didn't had before ...