middleman-livereload icon indicating copy to clipboard operation
middleman-livereload copied to clipboard

LiveReload is not reloading

Open mhluska opened this issue 10 years ago • 12 comments

Upon changing files, I get one live reload which results in a bunch of net::ERR_CONNECTION_REFUSED and net::ERR_CONNECTION_RESET in the console. Subsequent file edits don't trigger a live reload.

Using apply_js_live: false, apply_css_live: false doesn't help.

Ruby version: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin13] Middleman versions:

middleman (3.4.0)
middleman-blog (3.5.3)
middleman-deploy (1.0.0)
middleman-dotenv (1.1.1)
middleman-livereload (3.4.3)
middleman-sprockets (3.4.2)

Gemfile: https://gist.github.com/mhluska/67661370e223433f1a52 Gemfile.lock: https://gist.github.com/mhluska/dab537340a4a159964ef config.rb: https://gist.github.com/mhluska/06698df76350cb77f178

mhluska avatar Aug 13 '15 17:08 mhluska

Watching... I am seeing the same thing..

chrishough avatar Dec 22 '15 07:12 chrishough

+1 Livereload does not work since 3.4.0 upgrade. I'm using Pow with updated config.ru, but Livereload does not work with middleman server as well

amirnissim avatar Jan 05 '16 15:01 amirnissim

Are you all on v3.4.5?

tdreyno avatar Jan 05 '16 17:01 tdreyno

@tdreyno I'm on 3.4.0, is 3.4.5 available? Could not find gem 'middleman (= 3.4.5) ruby' in any of the gem sources listed in your Gemfile or available on this machine.

amirnissim avatar Jan 05 '16 19:01 amirnissim

Try bundle update to get the latest versions

tdreyno avatar Jan 05 '16 20:01 tdreyno

@tdreyno latest seems to be 3.4.1

amirnissim avatar Jan 06 '16 13:01 amirnissim

yeah, I thought you were talking about livereload (which is this bug tracker) not Middleman core

tdreyno avatar Jan 06 '16 21:01 tdreyno

In order to fix this locally, I added this to my config file:

if ENV["LIVERELOAD"]
  configure :development do
    activate :livereload, host: '127.0.0.1', apply_js_live: false, apply_css_live: false
  end
end

and use a rake task to boot up around it:

namespace :server do
  desc 'Work on the site with livereload'
  task :development => ["utilities:build:purge:middleman_files"] do
        msg("Cranking up the development server running on port 4567")
        msg("Open your browser to http://localhost:4567/")
        shell('LIVERELOAD=true middleman server -e development --verbose')
    end

  desc 'Start up the site for binding.pry and no livereload'
  task :development_pry => ["utilities:build:purge:middleman_files"] do
        msg("Cranking up the development server running on port 4567")
        msg("Open your browser to http://localhost:4567/")
        shell('middleman server -e development_pry --verbose')
    end

  desc 'Build the site'
  task :build => ["utilities:build:purge:middleman_files"] do
    msg("Building static files, but I will not be starting the server")
    shell('time middleman build --verbose')
  end
end

chrishough avatar Jan 06 '16 21:01 chrishough

I had the same problem with middleman-livereload 3.4.6 under Windows with ruby --version,

ruby 2.2.4p230 (2015-12-16 revision 53155) [x64-mingw32]

where livereload did not reload properly. I tried with MM4 and the reload worked smoothly, but other issues keep me from migrating to MM4 right now. However, my livereload started functioning with putting the following into the config.rb:

activate :livereload, :host => "127.0.0.1",
         :livereload_css_target => nil

:livereload_css_target => nil forces a full page refresh as described in the MM documentation für livereload.

karland avatar Feb 18 '16 16:02 karland

I'm doing some issue-gardening 🌿🌷🌾 and came across this issue.

Has this been solved in V4? If so can we close this issue?

sandstrom avatar Jul 28 '17 09:07 sandstrom

Still an issue today. @karland's addition of the :host param did the trick for me.

typeoneerror avatar Jun 26 '18 06:06 typeoneerror