-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Deferred template crashes server #12655
Comments
Not really. I understand the what, just not the how. This feature is fairly straight forward for regular
I guess the main reason I have not seen this in my setups is that I have constructs similar to this: That is, in your setup, the defer block will change whenever the stylesheet/fingerprint changes, which (in my head) has several drawbacks. |
My reasoning for using defer was I found using Tailwind's purging resulted in weird builds during development where it often would require a full restart of the dev server to get classes that were previously missing.
Just realised this is because it stopped using I've never had problems with Hugo generating CSS on a live build (ie just |
Yea, OK, that doesn't work ... well. I have had some browser live reload issues myself lately (one issue seem to be a newly introduced bug in Chrome). I have pushed a reimplementation (with better info loggin) to Hugo's main branch, but haven't released yet, will soon. |
Thanks Bep, I've removed {{ with (templates.Defer (dict "key" "global")) -}}
{{- $options := (dict "inlineImports" true ) -}}
{{- $tailwind := resources.Get "css/main.css" | resources.PostCSS $options -}}
{{- if hugo.IsDevelopment -}}
<link rel="stylesheet" href="{{ $tailwind.RelPermalink }}" />
{{- else -}}
{{- $tailwind = $tailwind | resources.Fingerprint "sha512" -}}
<link
rel="stylesheet"
href="{{ $tailwind.RelPermalink }}"
integrity="{{ $tailwind.Data.Integrity }}"
crossorigin="anonymous"
/>
{{- end -}}
{{- end }} Since moving to the new format I'm now getting a slightly new error:
Happy to open a new issue if thats easier. |
No, it's most likely the same issue, but with a more clear text ... But I have note been able to reproduce it (I have had a bash script doing some edits in a loop for the last hour ...), but I guess it will eventually happen. |
That just doesn't work. See gohugoio#12655
I'll keep an eye out for this but I have a feeling this was fixed in #13155. I haven't experienced it since upgrading to |
I have had the server running with frequent rebuilds with some "defer heavy" projects lately, and I have not seen a single panic, so I'm closing this for now. Someone will certainly re-raise the issue if it happens again. |
What version of Hugo are you using (
hugo version
)?I normally use the extended version but currently seem to just have the standard version installed.
Does this issue reproduce with the latest release?
Yes
I'm currently trying the new deferred templates since I've historically found when changing my CSS classes Hugo can sometimes generate an outdated Tailwind build. Every now and then though my dev server panics and crashes with the below error:
This is the result of me editing a post on the site.
My deferred template looks like this:
Which is included in my
baseof.html
via{{ partialCached "head/css" . }}
. I've tried moving it to justbaseof.html
but it crashes randomly doing that as well.Anything I can do to help debug?
The text was updated successfully, but these errors were encountered: