HUGO

SCSS Fingerprint Always the Same

I’m always getting a cached version of my CSS file. This is from the home page (layouts/index.html).

{{ $sass := resources.Get "sass/dgl.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}

When updating the scss, I always get the following resource:

/sass/dgl.min.7f1f50120d7cf6789181ca4f62af1fc6240c556314051dd6c1dba58e8f41ab91.css

When changing the CSS file name, or changing the fingerprint, the server says TOCSS: failed to transform "sass/###.scss" (text/x-scss): resource not found in file cache.

  • Tried the usual CSS refresh stuff like hard reload, private tab
  • Tried deleting the public folder
  • Tried removing the style sheet reference in the baseof.html
  • Tried restarting the server, --disableFastRender, --cleanDestinationDir
  • Tried adding an SHA key like the docs say (results in server error like resource "scss/sass/dgl.scss_bf33de2c3cf2124139041b9862aa9f46" not found in file cache)
  • Tried deleting the baseof template

As far as I know, a fingerprint should be unique, so each new save I make should trigger a reload. However, this is not happening. Perhaps it’s a misunderstanding; I don’t remember where the original example was from. By the way, this is my repo: DenisLabrecque/Denis-Labrecque-Website-2020: Hugo website redesign (github.com) see the index file.

Continuing the discussion from Scss changes not live reloading:

Note: the version of this installed on my laptop seemed to be working, so I deleted the repo on my main computer, but this keeps happening. However, there’s something in resources\_gen\assets\scss\...\dgl.scss_###.json that I did not notice was changing in Git. So it may have something to do with the working environment.

From what I see, it seems that my laptop installation of Hugo is extended, while my main computer’s version isn’t. Not sure why, and also not sure why I skipped this solution earlier. This fixed my issue.

To fix using Chocolatey
choco install hugo-extended

1 Like

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