middleman / middleman-livereload

LiveReload support for Middleman
http://middlemanapp.com
MIT License
118 stars 39 forks source link

LiveReload is not reloading #76

Open mhluska opened 9 years ago

mhluska commented 9 years ago

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

chrishough commented 8 years ago

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

amirnissim commented 8 years ago

+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

tdreyno commented 8 years ago

Are you all on v3.4.5?

amirnissim commented 8 years ago

@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.

tdreyno commented 8 years ago

Try bundle update to get the latest versions

amirnissim commented 8 years ago

@tdreyno latest seems to be 3.4.1

tdreyno commented 8 years ago

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

chrishough commented 8 years ago

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
karland commented 8 years ago

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.

sandstrom commented 7 years ago

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

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

typeoneerror commented 6 years ago

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