Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Livereload address always returns error This port only serves livereload.js over HTTP #6701

Closed
6 of 18 tasks
suffolklibraries opened this issue Jan 17, 2018 · 7 comments
Closed
6 of 18 tasks
Labels
frozen-due-to-age support This is a question about Jekyll's usage.

Comments

@suffolklibraries
Copy link

When I build with bundle exec jekyll s --livereload the site builds as expected. I get the following confirmation:

done in 154.694 seconds. Auto-regeneration: enabled for '/Users/leon/Sites/sljekyll' LiveReload address: http://127.0.0.1:35729 Server address: http://127.0.0.1:4000/ Server running... press ctrl-c to stop. LiveReload: Browser connected

However, if I navigate to http://127.0.0.1:35729, I always get this error message:

This port only serves livereload.js over HTTP

  • I believe this to be a bug, not a question about using Jekyll.
  • I updated to the latest Jekyll (or) if on GitHub Pages to the latest github-pages
  • I ran jekyll doctor to check my configuration
  • I read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/
  • This is a feature request.

  • I am on (or have tested on) macOS 10+ 10.13.2
  • I am on (or have tested on) Debian/Ubuntu GNU/Linux
  • I am on (or have tested on) Fedora GNU/Linux
  • I am on (or have tested on) Arch GNU/Linux
  • I am on (or have tested on) Other GNU/Linux
  • I am on (or have tested on) Windows 10+

  • I was trying to install.
  • There is a broken Plugin API.
  • I had an error on GitHub Pages, and I have reproduced it locally.
  • I had an error on GitHub Pages, and GitHub Support said it was a Jekyll Bug.
  • I had an error on GitHub Pages and I did not test it locally.
  • I was trying to build.
  • It was another bug.

My Reproduction Steps

  • Ran bundle update to update to Jekyll 3.7.0
  • Ran bundle exec jekyll s --livereload to build site with Livereload enabled
  • Command line returns expected messages (see above) but http://127.0.0.1:35729 returns the above message

Gemfile

source "https://rubygems.org"

gem "jekyll"
gem "pathutil"
gem "addressable"

group :jekyll_plugins do
gem "jekyll-paginate-v2"
end

Gemfile.lock

GEM
remote: https://rubygems.org/
specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
concurrent-ruby (1.0.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (> 0.6.0)
eventmachine (1.2.5)
ffi (1.9.18)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (0.9.1)
concurrent-ruby (
> 1.0)
jekyll (3.7.0)
addressable (> 2.4)
colorator (
> 1.0)
em-websocket (> 0.5)
i18n (
> 0.7)
jekyll-sass-converter (> 1.0)
jekyll-watch (
> 2.0)
kramdown (> 1.14)
liquid (
> 4.0)
mercenary (> 0.3.3)
pathutil (
> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (> 1.0)
jekyll-paginate-v2 (1.9.2)
jekyll (
> 3.0)
jekyll-sass-converter (1.5.1)
sass (> 3.4)
jekyll-watch (2.0.0)
listen (
> 3.0)
kramdown (1.16.2)
liquid (4.0.0)
listen (3.1.5)
rb-fsevent (> 0.9, >= 0.9.4)
rb-inotify (
> 0.9, >= 0.9.7)
ruby_dep (> 1.2)
mercenary (0.3.6)
pathutil (0.16.1)
forwardable-extended (
> 2.6)
public_suffix (3.0.1)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (3.1.0)
ruby_dep (1.5.0)
safe_yaml (1.0.4)
sass (3.5.5)
sass-listen (> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (
> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)

PLATFORMS
ruby

DEPENDENCIES
addressable
jekyll
jekyll-paginate-v2
pathutil

BUNDLED WITH
1.16.1

Ruby version: 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]

The Output I Wanted

Output was as expected.

@DirtyF
Copy link
Member

DirtyF commented Jan 17, 2018

Using --livereload option does not change the fact that your website preview is on http://127.0.0.1:4000/, the other URL is used internally by livereload and is not meant to be used by Jekyll or anyone else.

@DirtyF DirtyF closed this as completed Jan 17, 2018
@DirtyF DirtyF added the support This is a question about Jekyll's usage. label Jan 17, 2018
@suffolklibraries
Copy link
Author

Sorry, my bad, and for wasting your time. http://127.0.0.1:4000/ doesn't live reload either

@DirtyF
Copy link
Member

DirtyF commented Jan 17, 2018

Well, I'm currently using Jekyll 3.7.0 on macOS 10.3 and here's my output:

 bundle exec jekyll serve --livereload
...
      Generating...
                    done in 0.097 seconds.
 Auto-regeneration: enabled for '/Users/frank/code/jekyll/tests/mon-super-theme'
LiveReload address: http://127.0.0.1:35729
    Server address: http://127.0.0.1:4000
  Server running... press ctrl-c to stop.
      Regenerating: 1 file(s) changed at 2018-01-17 16:48:54
                    _layouts/home.html
                    ...done in 0.041296 seconds.

        LiveReload: Browser connected
      Regenerating: 1 file(s) changed at 2018-01-17 16:49:28
                    _layouts/home.html
                    ...done in 0.037895 seconds.

      Regenerating: 1 file(s) changed at 2018-01-17 16:49:48
                    _layouts/home.html
                    ...done in 0.03737 seconds.

      Regenerating: 1 file(s) changed at 2018-01-17 16:49:53
                    _layouts/home.html
                    ...done in 0.029774 seconds.

      Regenerating: 1 file(s) changed at 2018-01-17 16:50:07
                    _layouts/home.html
                    ...done in 0.031536 seconds.
...

What's yours?

@WilliamIPark
Copy link

WilliamIPark commented Mar 1, 2018

I'm having the same issue.

bundle exec jekyll serve --livereload

Configuration file: /Users/william/workspace/portfolio/_config.yml
            Source: /Users/william/workspace/portfolio
       Destination: /Users/william/workspace/portfolio/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 0.405 seconds.
 Auto-regeneration: enabled for '/Users/william/workspace/portfolio'
LiveReload address: http://127.0.0.1:35729
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.
      Regenerating: 1 file(s) changed at 2018-03-01 20:26:07
                    index.html
                    ...done in 0.223699 seconds.

[2018-03-01 20:26:31] ERROR `/favicon.ico' not found.
      Regenerating: 1 file(s) changed at 2018-03-01 20:26:34
                    index.html
                    ...done in 0.249388 seconds.

      Regenerating: 1 file(s) changed at 2018-03-01 20:26:54
                    index.html
                    ...done in 0.157734 seconds.

      Regenerating: 1 file(s) changed at 2018-03-01 20:26:55
                    index.html
                    ...done in 0.148649 seconds.

Live reload doesn't work on port 4000

This issue should be re-opened, it has been prematurely closed.

@WilliamIPark
Copy link

Found the solution:
You must have a <head> in your page otherwise the livereload script doesn't get injected.

@russellbrown
Copy link

I also can't get livereload to work on newer versions of Jekyll. It works fine on older versions (<3.7) with the livereload plugin. I'm now trying with Jekyll 3.8.3 on ruby 2.4 and Mac 10.13.6, I've tried running jekyll serve --livereload and I've also tried adding livereload: true to _config.yml - in both cases the web server starts at http://127.0.0.1:4000, the livereload server starts at http://127.0.0.1:35729, the generated webpage includes the reference to livereload.js in the <script> in the <head> and the console log also indicates LiveReload: Browser connected however the browser simply does not refresh when a file (html/markdown/css, etc.) is edited and saved. Any ideas?

@dharmeshkakadia
Copy link

I was initially seeing same behavior - correct script tag in the head but no refresh. It started working for me after I removed --incremental flag. It seems like --incremental and --livereload doesn't work together. Posting here in case its useful for someone else.

@jekyll jekyll locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age support This is a question about Jekyll's usage.
Projects
None yet
Development

No branches or pull requests

6 participants