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
Development server LiveReloads before change is ready #12462
Comments
I am unable to reproduce this with v0.125.6 (I did not test v0.125.5). My test site has 10 pages, and each page renders a side bar containing the titles of all pages in the section. I tested your sequence using both vim (version 8.2.2121) and VS Code. hugo v0.125.6-69ede10edcd539380914bbee58d4d32953dd8b43+extended linux/amd64 BuildDate=2024-05-05T10:52:52Z VendorInfo=gohugoio I believe it is happening, I just can't reproduce the problem. |
My site has a few more pages and images to process:
Which means longer build time. I think the issue is a result of the build (started on write) taking longer than it takes my browser to gain focus (and reload.) I can reproduce it on the latest version:
Vim config to write on losing focus: |
Hugo's debug log upon saving a changed file... editor = gedit
edit = vim
From the above, it's apparent that vim is doing a lot of things when editing and saving a file. Can you repeat your test with another editor, perhaps gedit or vscode? |
It reproduces in emacs. If the file is very short it does not happen. Otherwise I can reliably reproduce it in both editors. Feel free to try it with my site yourself: jneidel/blog (e.g. This is the debug log of one reproduction: Change detected, rebuilding site (#62).
2024-05-08 07:46:48.445 +0200
DEBUG cachebuster: Matching "content/_index.md" with source "(postcss|tailwind)\\.config\\.js": no match
Source changed /_index.md
DEBUG Direct dependencies of "/" (*hugolib.pageState page-112) =>
__anonymous
shortcodes/hovericon.html
/guide/transcoding/transcoding-example-jess-crf-26.png
/icons/email.svg
/tags/no-complaints
/talk/tech-problems
/img/profile-picture.jpg
/guide/transcoding/transcoding-reason.png
/guide/transcoding/jellyfin-video-codecs.png
/misc/reflection/2023-44
/guide/transcoding/torrent-source-webrip.png
partials/picture.html
_default/_markup/render-image.html
shortcodes/figure.html
shortcodes/button.html
partials/inline/h-rh-l/validate-fragment.html
/guide/transcoding/transcoding-example-seinfeld.png
shortcodes/icon.html
/guide/transcoding/torrent-source-web-dl.png
shortcodes/lead.html
/icons/rss.svg
/guide/transcoding/transcoding-example-jess-crf-38.png
_default/_markup/render-link.html
/guide/transcoding/transcoding-example-office.png
/guide/transcoding/transcoding-cpu-at-80.png
/guide
_default/_markup/render-heading.html
/guide/transcoding/jellyfin-audio-codecs.png
/icons/gpg.svg
INFO build: step process substep resolve page output change set changes 1 checked 139 matches 52 duration 2.041451ms
INFO build: step process substep gc dynacache duration 1.117732ms
INFO build: step process substep collect files 3 files_total 3 duration 397.337µs
INFO build: step process duration 4.028937ms
DEBUG Direct dependencies of "/dev/transmission-wireguard" (*hugolib.pageState page-98) =>
_default/_markup/render-heading.html
INFO build: step assemble substep resolve page output change set changes 1 checked 67 matches 1 duration 600.862µs
INFO build: step assemble substep gc dynacache duration 667.185µs
INFO build: step assemble duration 2.375169ms
WARN The "link" render hook was unable to resolve the destination "++" in guide/browser/index.md
DEBUG Write redirect to main language en: //localhost:1313/
INFO build: step render substep pages site en outputFormat html duration 61.606035ms
INFO build: step render substep pages site en outputFormat json duration 28.148955ms
INFO build: step render substep pages site en outputFormat rss duration 8.088973ms
INFO build: step render substep pages site de outputFormat html duration 29.623676ms
INFO build: step render substep pages site de outputFormat json duration 2.916619ms
INFO build: step render substep pages site de outputFormat rss duration 7.442455ms
INFO build: step render pages 20 content 45 duration 138.918243ms
INFO build: step postProcess duration 14.437µs
INFO build: duration 146.295138ms
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Total in 147 ms |
This may not be related, but emacs also creates lock files: Can you repeat your test with another editor, perhaps gedit or vscode? |
Can confirm it also happens with gedit. |
I was also unable to reproduce this with the Hugo documentation repository, which isn't small:
I don't use i3, and I have no idea if that would be a factor here. |
I'm not saying this is connected to the above, but you should define a |
I don't think it's so much about project size, but about the contents of the page to be regenerated. I tried the documentation repo and can't reproduce it there. It might happen because there are images being reprocessed with hugo pipes (my theme does this.) This is the case on the pages in my project that I could reproduce it on. You can try in on my project: git submodule init
git submodule update
hugo server -p 1313 --navigateToChanged And then open http://localhost:1313/guide/transcoding/ |
I tested your project (good looking site) and did misc edits in different Markdown files, and all changes refreshed in the browser (build times 30-60ms). Could you try What I can say is:
|
I had already tried My build time is significantly slower at 90-200ms. Maybe a video recording helps? OS:
|
In my workflow the live reload happens to early (before hugo has finished building the change), so that I have to manually reload to see the rendering of my change.
The server command is:
hugo server -D --navigateToChanged
Broken flow
Working flow
notes
Things I tried that don't effect the behavior:
--disableLiveReload
--poll 700ms
--renderToMemory
Because of
navigateToChanged
it will navigate to the right page, but the change will not be there yet.Here are some rebuild times:
I switched my theme to congo, I do not remember this being an using with ananke (maybe less heavy.)
What version of Hugo are you using (
hugo version
)?The text was updated successfully, but these errors were encountered: