Live Reload not detecting changes after first edit

Hugo is not recognizing changes to config.toml after the first edit for me.
I see 7 separate issues filed against Hugo Live reload and I am not sure if this is already a known issue.
I read thru the published documentation on live reload.
I am using Introduction Theme unchanged except for attempted edits to config.toml
Is there something I am missing? Thanks!

Steps:
Start Hugo server which declares “watching for changes in config.toml”
open config.toml in vi editor
Make change to a param called tagline write change
View “Change Detected, rebuilding site”
View change in browser
Make another change to tagline and write change
View absence of “Change Detected” issued from Hugo

[root@fedora28 t2]# hugo server -D --baseURL="http://192.168.1.79/" --bind="192.168.1.79" --port=80

                   | EN  
+------------------+----+
  Pages            | 30  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     | 35  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 229 ms
Watching for changes in /home/ktst/hu2/t2/{content,data,layouts,static,themes}
Watching for config changes in /home/ktst/hu2/t2/config.toml
Watching for config changes in /home/ktst/hu2/t2/themes/introduction/config.toml
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://192.168.1.79:80/ (bind address 192.168.1.79)
Press Ctrl+C to stop

Change detected, rebuilding site
2018-09-10 18:07:58.816 -0400
Total in 6 ms
^C[root@fedora28 t2]# hugo version
Hugo Static Site Generator v0.47.1 linux/amd64 BuildDate: 2018-08-20T08:16:52Z
[root@fedora28 t2]# 

I narrowed this issue down a bit.
Installed v.48
Made new directory
ran hugo newsite example.com
cd to example.com
ran hugo server
Observed Watching config.toml
edited config.toml
Observed change detected timestamp
Subsequent editing of config.toml fails to rebuild site or change time stamp.

Do forum experts think this is expected behavior or should I file a bug report?
Thanks!

What exactly are you changing in your

subsequent editing of config.toml

So that we can attempt to reproduce this

Hugo self generates a config.toml when “hugo sitenew” is issued.

I edited the title line.

 title = "My New Hugo SiteZ"

While watching the bash window which is running

[root@fedora28 example.com]#  /usr/local/bin/hugo server

                   | EN  
+------------------+----+
  Pages            |  3  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     |  1  
  Processed images |  0  
  Aliases          |  0  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 6 ms
Watching for changes in /home/ktst/huskel/example.com/{content,data,layouts,static}
Watching for config changes in /home/ktst/huskel/example.com/config.toml
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
    
Change detected, rebuilding site
2018-09-11 12:48:19.158 -0400
Total in 19 ms

I used these steps when attempting to reproduce your issue. But I could not reproduce it.

  1. Install Hugo 0.48
  2. hugo new site example.com
  3. cd example.com
  4. git init
  5. git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
  6. Open config.toml and add line theme = "ananke"
  7. hugo new posts/my-first-post.md
  8. hugo server -D
  9. Open config.toml and edit line title = "My New Hugo Site" to be title = "My New Hugo SiteZ"

The first edit of config.toml produces change detected with a timestamp.

Subsequent edits of config.toml are not producing the change detected message for me.

Is that what you are testing?

You said that live reload is not detecting changes after first edit, so that is what I tested.

So now are you saying that your site builds fine, but you are not seeing an updated timestamp when editing config.toml? Please be specific.

If that is the case, I cannot reproduce that issue either. Below is my console output after multiple edits to config.toml. As you can see, it shows the timestamp each time.

MACHINENAME:example.com username$ hugo server -D

                   | EN  
+------------------+----+
  Pages            | 10  
  Paginator pages  |  0  
  Non-page files   |  0  
  Static files     |  3  
  Processed images |  0  
  Aliases          |  1  
  Sitemaps         |  1  
  Cleaned          |  0  

Total in 15 ms
Watching for changes in /Users/username/Sites/example.com/{content,data,layouts,static,themes}
Watching for config changes in /Users/username/Sites/example.com/config.toml
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Change detected, rebuilding site
2018-09-12 11:13:37.275 -0500
Total in 2 ms

Change detected, rebuilding site
2018-09-12 11:13:45.274 -0500
Total in 2 ms

What Operating system are you testing on?

I am using Fedora 28 and Amazon ec2 Linux.

I used MacOS High Sierra for my above testing.

Maybe someone else who is also on Fedora can help you.

Thanks for testing.

This may very well be OS dependent.

Hi,
Have you read through this post: Hugo server --watch not... er... 'watching" ?

Thanks for this reference.
Not sure what to gather from it though.
I found out thru testing that hugo does detect all changes to a test.html file in the static folder which tells me detection of changes is possible, but is being treated somewhat differently for the config.toml file.
I went ahead and created an issue.

In your first post you mentioned that you had several errors. My experience has been that when Hugo live does NOT rebuild on the fly, it has been due to errors creeping in somewhere.

Thank You for this information.
I attempted to boil the test down to just essential steps for demonstrating the problem and reducing the possibility for errors.
So far the issue filed on github has not been rejected or closed.

I’m having the same issue but thought I was the only one so I never mentioned it here.

1 Like

It could just be your browser cache storing the old version. That happens to me sometimes. If you go to the “quickstart” tutorial and scroll down to the bottom of the page, in the last tip there is a link to a website that explains how to clear your cache in almost any browser.

@Leoj03

It could just be your browser cache storing the old version.

The old version of what? Their issue is about edits to config.toml not being picked up.

Oh, my bad. I guess I didn’t read it carefully enough.
Though, I have had experience with that, too. If you run hugo server --disableFastRender, it will watch the config for at least the first edit. I do find that I often have to close the browser window, clear my cache, stop the server, and close the text editor with the config file, then open it all again.

I followed exactly the steps outlined by zwbetz and also attempted to edit the config.toml multiple times, but my instance of hugo also failed to detect any file changes in config.toml beyond the very first file change. And I’m on MacOS.

$ hugo version
Hugo Static Site Generator v0.53/extended darwin/amd64 BuildDate: unknown

Would be happy to help maintainers debug this.

I tried to get some interest in this, but apparently it is not a problem for most people. It could be that its not worth the time to pursue, or that most can’t replicate the problem. I don’t know the code logic behind the detection, but hopefully its not symptomatic of a more serious underlying bug.