gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
74.62k stars 7.45k forks source link

Partial live reload not working for mixed case templates #12165

Closed FN-FAL113 closed 5 months ago

FN-FAL113 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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.

FN-FAL113 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

@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 commented 6 months ago

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 commented 6 months ago

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.

github-actions[bot] commented 4 months ago

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.