Hugo.exe server stops serving after a static file has changed

Hello there,

I am developing in a windows environment and I run hugo server locally during development.

I find that it stop serving pages when I change a static file, such as css files…(anything in the \static\ directory) … I then consequently have to manually restart the server…which is a real pain…:slight_smile:

I was wondering if this is by design? or is there a way to make it keep serving after changing static content?

I currently run the server with the following switches
&hugo.exe server --navigateToChanged --gc --cleanDestinationDir --disableFastRender --disableLiveReload --forceSyncStatic

This is what I see in my hugo window after I change a static file…

This is what I see in my webbrowser after I change a static file…

Thank you kindly for any ideas
John

Try removing this option: --disableLiveReload

1 Like

Thank you zwbetz. I tried. Still same result (except that it goes to the 404 page not found quicker:)) …

I do run hugo from a powershell script. I doubt that would have anything to do with it. (Ok, so I tested it to be sure and it seems I am possibly wrong)…I think it has something to do with the powershell script and perhaps some kind of permissions perhaps…

I have run out of time at the moment to figure it out…but I will report back with findings…

Thanks zwbetz…(and anyone else who might have some suggestions)

A wild guess: if it does not happen when you run things step by step from cmd.exe, maybe the system environment after you launch powershell is somehow different.

Just a small update…(I own children so working from home gets me half way through anything)…

Contrary to what I said last post, it doesnt appear to be related to powershell…

  • If I run hugo server without ANY parameters, I can run it through powershell without any problems
  • If I run directly on command line without any parameters, everything runs without any problems
  • If I run hugo server with the following parameters, running it through powershell I get the stated problem
    &hugo.exe server --navigateToChanged --gc --cleanDestinationDir --disableFastRender --forceSyncStatic
  • If I run directly on the command line with the above parameters I get the same original stated problem

So I erroneously thought it was powershell forgetting that I had tested the command line with no parameters…

So it’s a matter of figuring out which paramater is causing the behaviour…

For that I will return tommorrow when I get time…

Thanks for reading and suggestions. Pretty sure I’ll have the answer tomorrow so anyone running into this thread will have an answer.

Thank you
John

Hi all,

Here is an update;
Running with the following parameters works fine;
hugo.exe server --navigateToChanged --disableFastRender --forceSyncStatic

Running with the following parameters causes original problem (needing hugo restart on static change)
hugo.exe server --navigateToChanged --disableFastRender --forceSyncStatic --disableLiveReload --gc --cleanDestinationDir

One might note that those extra switches are for the most part unnecessary anyway unless one uses them in conjunction with --renderToDisk (which I was using at one point to learn where Hugo was putting things)

Hope that helps someone.

That option does what it says :wink:

heh could go along way to explaining it :slight_smile:

In my noobie ways, I think in my mind I was imagining --disableLiveReload to be similar to --navigateToChanged…the description of it in help says “watch without enabling live browser reload on rebuild” … which to me isn’t exactly clear… but anyway…problem solved…

How would you make it more clear?

Well, what is a live browser reload? I read that as the browser reloading the page (nothing to do with anything on a server)… and that may just be due to ignorance on my behalf of what is actually happening…(I presume I am not the only one in that boat tho)

That’s a difficult one to answer in help text; it presumes a development pattern, so it’s gonna confuse some folks.

I recommend to everyone: use the least amount of parameters as possible. We should put that in the help message! :slight_smile: