Hugo's Tailwind starter template CSS issue

I am having some slight issues with the starter template configurations in my own site:

  1. When using Tailwind’s @apply feature where the CSS does not reflect unless I run hugo --gc and then restart the server.
  2. Where, despite live reload, sometimes the styles are cached by the browser until I hard refresh. (Should I run the command as hugo server --noHTTPCache?)
  3. I call the postProcess code in a partial and it fails the build sometimes when I run hugo server with the error error calling partial: partial "assets/head.html" timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the 'timeout' config setting.

I am looking for ideas on how to solve these three issues.

Solved this by adding timeout="10m" to the configuration file. Now to the other two…

Disabling fast render solves the first issue. I am whether not sure if this is a bug? cc @jmooring @bep

I’m pretty sure it’s a misconfiguration in your project.

And since I cannot see your site’s source, I suggest you start out fresh. I tested this OK just now:

  1. Start with a fresh clone of GitHub - bep/hugo-starter-tailwind-basic: A basic and simple to set up Hugo with TailwindCSS starter project.
  2. Run hugo server
  3. Edit styles/HTML add some @apply etc. Watch the home page get resyled.

Disabling fast render solves the first issue. I am whether not sure if this is a bug? cc @jmooring @bep

Also, for the future, unless you have something that’s only relevant for a given person, please don’t use the above constructs, it’s just annoying. I read most of the threads in here.

I deleted the node_modules and reinstalled afresh. Works for now. Will test more later.

1 Like

I found some (2) issues related to the case where you’re starting out with no hugo_stats.json which may be what you’re getting confused by:

See Check initial server build when no hugo_stats.json file exists · Issue #11264 · gohugoio/hugo · GitHub

I’m looking at the fix as we speak.

Excellent! (The issue did occur again, but let me try the new version 0.115.4 and see if it solves the issue.)

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.