zola icon indicating copy to clipboard operation
zola copied to clipboard

zola serve not reloading when config.toml is changed

Open Raymi306 opened this issue 1 year ago • 7 comments

Bug Report

zola serve does not detect changes to config.toml, but says it should

Environment

Linux Zola version: 0.17.2

Expected Behavior

Tell us what should have happened.

If config.toml gets written to, zola serve should reload

Current Behavior

Tell us what happens instead of the expected behavior. If you are seeing an error, please include the full error message and stack trace. You can get the stacktrace of a panic by adding RUST_BACKTRACE=1 when running a zola command.

Nothing happens

Step to reproduce

Please provide the steps to reproduce the issue. If the issue is hard to reproduce, please provide a sample repository or sample that triggers the bug.

zola init
zola serve
vi config.toml
# edit a variable and save

Raymi306 avatar Aug 10 '23 16:08 Raymi306

Hm i've just tested locally and it works for me on Mac? Might be a OS specific issue

Keats avatar Aug 13 '23 15:08 Keats

I just retested this on master and next builds, it looks like touch triggers the reload but editing and saving in vi is not for me? I'm gonna poke around some more.

Raymi306 avatar Aug 13 '23 16:08 Raymi306

Specifically I am using nvim. I added a println! to the front of the match for watcher events and to the fallthrough _ branch. The first time I open and save a file with zola serve running, I get:

NoticeRemove("/home/.../config.toml")

Afterwards, touch fails to trigger a reload and saves in nvim and touches don't even register in the match handler...

Raymi306 avatar Aug 13 '23 16:08 Raymi306

https://github.com/notify-rs/notify/issues/247

Raymi306 avatar Aug 13 '23 16:08 Raymi306

hey this may be a necrobump, but for vim users if you do : :set nobackup nowritebackup that solves the issue, i know i had a similar issue with another software but i don't remember which, the culprit is that vim replaces the original file with a new one without that option and so a rust library that is used to track the file stop tracking it.

alkeryn avatar Dec 11 '23 22:12 alkeryn

Can you try https://github.com/getzola/zola/pull/2269 as well without those options changed?

Keats avatar Dec 12 '23 08:12 Keats

I took a crack at it in https://github.com/getzola/zola/pull/2498 .

iamorphen avatar May 16 '24 11:05 iamorphen