Hugo - Failed to find a valid digest in the 'integrity' attribute for resource

After cloning my Hugo site to a new machine and running:

hugo server

No CSS would load and the console was reporting the following error:

Failed to find a valid digest in the 'integrity' attribute for resource

The problem was that the CSS for the theme is using the integrity attribute to allow the browser to guarantee that the file downloaded has not been manipulated from the source. For some reason Hugo was regenerating the CSS with a different hash than what was expected, I suspect this might be a git line ending issue.

Deleting the regenerated CSS files and reverting back to the original versions that matched the hash solved the problem until I get chance to look into this more.

comments powered by Disqus