Skip to content
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

Partial live reload not working for mixed case templates #12165

Closed
FN-FAL113 opened this issue Feb 27, 2024 · 8 comments · Fixed by #12287
Closed

Partial live reload not working for mixed case templates #12165

FN-FAL113 opened this issue Feb 27, 2024 · 8 comments · Fixed by #12287

Comments

@FN-FAL113
Copy link

FN-FAL113 commented Feb 27, 2024

The css are declared in a style declaration tag. CSS from the parent element are being updated properly in the page but with partials I have to change to different page then go back. I tried updating hugo from v0.123.3 to the latest but no to avail.

OS: Windows 11 (22H2)
IDE: vscode
BROWSER: Chrome/Edge/Firefox

UPDATE: Even the partial does not get updated when changing its html, I have tried various arguments like no http cache, ignore cache and disable fast render, still not working unfortunately. The partial is in a loop that receives an iterated regular page context.

What version of Hugo are you using (hugo version)?

hugo v0.123.4-21a41003c4633b142ac565c52da22924dc30637a+extended windows/amd64 BuildDate=2024-02-26T16:33:05Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

Yes

@FN-FAL113 FN-FAL113 changed the title Partial css changes not being rendered but detected by CLI Partial live reload not working Feb 27, 2024
@FN-FAL113
Copy link
Author

I have to downgrade for now using this version to experience a fully working live reload:

hugo v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended windows/amd64 BuildDate=2024-01-26T15:54:24Z VendorInfo=gohugoio

@bep
Copy link
Member

bep commented Feb 27, 2024

We re-implemented the partial server rebuilds in Hugo v0.123.0 from a coarse grained to a more fine grained strategy. It's not possible for us with the little information you provide to determine why this isn't working for you. If you want us to look at it, we need a failing running source example. Note that you, in most cases, can get back to a more "coarse grained" approach (which is needed in some use cases, e.g. TailwindCSS) by set up some more cache buster rules, see Cache Busters. A related tip would be to run hugo --logLevel debug and see how well the current cache buster configuration matches.

@bep bep added this to the v0.124.0 milestone Feb 27, 2024
@FN-FAL113
Copy link
Author

original partial filename is in a camel case form.

Change detected, rebuilding site (#1).
2024-02-27 18:30:32.353 +0800
DEBUG cachebuster: Matching "layouts/partials/postcard.html" with source "(postcss|tailwind)\\.config\\.js": no match
52µs
INFO  build:  step process substep rebuild templates duration 8.7361ms
INFO  build:  step process duration 17.0109ms
INFO  build:  step assemble duration 0s
INFO  build:  step render substep pages site en outputFormat html duration 1.0012ms       
INFO  build:  step render substep pages site en outputFormat rss duration 0s
INFO  build:  step render pages 0 content 0 duration 3.5964ms
INFO  build:  step postProcess duration 0s
INFO  build:  duration 22.1652ms
Total in 22 ms

I'm new to hugo, any information you can deduce from this, thanks.

@FN-FAL113
Copy link
Author

Another set of debug messages:

Change detected, rebuilding site (#2).
2024-02-27 18:40:52.348 +0800
DEBUG cachebuster: Matching "layouts/partials/postcard.html" with source "(postcss|tailwind)\\.config\\.js": no match
Template added /partials/postcard.html
DEBUG Direct dependencies of "/partials/postcard.html" (*paths.Path) =>
INFO  build:  step process substep resolve page output change set changes 1 checked 35 matches 0 duration 539.8µs
INFO  build:  step process substep gc dynacache duration 606.2µs
INFO  build:  step process substep rebuild templates duration 6.4796ms
INFO  build:  step process duration 14.0897ms
INFO  build:  step assemble duration 0s
INFO  build:  step render substep pages site en outputFormat html duration 0s
INFO  build:  step render substep pages site en outputFormat rss duration 552.4µs
INFO  build:  step render pages 0 content 0 duration 3.2514ms
INFO  build:  step postProcess duration 0s
INFO  build:  duration 17.9574ms
Total in 17 ms

@jmooring
Copy link
Member

@FN-FAL113 See bep's response:

If you want us to look at it, we need a failing running source example.

That means we need a small test repo that successfully builds and consistently reproduces the condition you describe.

@FN-FAL113
Copy link
Author

FN-FAL113 commented Feb 27, 2024

https://github.com/FN-FAL113/hugo-test-partial-live-reload
a partial postCard.html is utilized as a component to render regular pages.
I have to restart the dev server in order for the changes in the partial to reflect. Devtools cache is also disabled.

@FN-FAL113
Copy link
Author

FN-FAL113 commented Feb 27, 2024

Seems like renaming the partial to all lowercase fixes the issue. Idk if this is a small fix but if its a great first issue I would like to contribute else I'm happy to share to you guys what may be the problem.

@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@bep bep self-assigned this Mar 20, 2024
@bep bep changed the title Partial live reload not working Partial live reload not working for mixed case templates Mar 20, 2024
@bep bep modified the milestones: v0.125.0, v0.124.1 Mar 20, 2024
bep added a commit to bep/hugo that referenced this issue Mar 20, 2024
bep added a commit to bep/hugo that referenced this issue Mar 20, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants