getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.53k stars 945 forks source link

zola serve - automatic firefox refresh leads to `Not Found` #2552

Closed lwandrebeck closed 3 months ago

lwandrebeck commented 3 months ago

Bug Report

Environment

Ubuntu 22.04 fully up to date Linux XXXX 6.5.0-41-generic #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 3 11:32:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux Firefox 127.0 Ubuntu snap zola serve -> Web server is available at http://127.0.0.1:1111 (bound to 127.0.0.1:1111) Theme used: easydocs

Zola version: 0.19.1 (happens since 0.19) Using https://github.com/getzola/zola/releases/download/v0.19.1/zola-v0.19.1-x86_64-unknown-linux-gnu.tar.gz

Expected Behavior

Before 0.19, saving contents made Firefox reload the page.

Current Behavior

Saving contents makes Firefox refresh and print Not Found. Hitting F5 makes content appear properly again.

Change detected @ 2024-06-26 10:46:12
-> Content changed /home/XXXX/site/content/infrastructure/smtp.md
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 32 pages (0 orphan) and 5 sections
-> Content changed /home/XXXX/site/content/infrastructure/smtp.md0HlVyu.bck
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 32 pages (0 orphan) and 5 sections
Done in 101ms.

Step to reproduce

zola serve Open Web page http://127.0.0.1:1111 with Firefox, go the page you’ll be editing. edit content/whatever.md save image

Keats commented 3 months ago

Content changed /home/XXXX/site/content/infrastructure/smtp.md0HlVyu.bck

I guess that might be part of the issue.

lwandrebeck commented 3 months ago

I can’t remember seeing such a thing with 0.18, agreed.

Keats commented 3 months ago

What's the editor that is creating .bck file?

lwandrebeck commented 3 months ago

I'm using Helix but such a problem did not happen with 0.18. Will check closer tomorrow with another editor to see if I can reproduce.

Keats commented 3 months ago

I've added .bck to the list of ignored extensions in the next branch for now. I haven't been able to reproduce it locally though :/

lwandrebeck commented 3 months ago

So I’ve tried with nano, and it worked fine. Tried then with hx, and got the .bck file and the Not Found Firefox error. I’m wondering what makes me it hit that each time but not on your side… btw I do use these alacritty, starship and hx versions:

❯ alacritty --version
alacritty 0.13.2
❯ starship --version
starship 1.19.0
branch:
commit_hash:
build_time:2024-05-16 13:21:33 +02:00
build_env:rustc 1.78.0 (9b00956e5 2024-04-29),stable-x86_64-unknown-linux-gnu
❯ hx --version
helix 24.3 (bb0bfa23)
lwandrebeck commented 3 months ago

Tried with zola-next and it indeed fixes the problem. 1st change via nano, 2nd change via hx. Firefox refreshes normally again. Thanks a lot !

❯ ~/zola-next/target/release/zola serve
Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 32 pages (0 orphan) and 5 sections
Done in 69ms.

Listening for changes in /home/XXX/site/{config.toml,content,sass,static,templates}
Press Ctrl+C to stop

Web server is available at http://127.0.0.1:1111 (bound to 127.0.0.1:1111)

Change detected @ 2024-07-02 10:22:06
-> Content changed /home/XXXX/site/content/_index.md
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 32 pages (0 orphan) and 5 sections
Done in 52ms.

Change detected @ 2024-07-02 10:24:00
-> Content changed /home/XXXX/site/content/_index.md
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 32 pages (0 orphan) and 5 sections
Done in 58ms.