Skip to content
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

Failed to find a valid digest Error #215

Open
dhje0ng opened this issue Feb 24, 2024 · 6 comments
Open

Failed to find a valid digest Error #215

dhje0ng opened this issue Feb 24, 2024 · 6 comments

Comments

@dhje0ng
Copy link

dhje0ng commented Feb 24, 2024

I followed the procedure to build the gokarna theme and deployed it via Github, but I got a

I am getting hash related errors that do not occur with hugo server -D.

Also, as a result of these errors, the icons, pictures, etc. displayed by the theme are not displaying correctly.

Can you help me to resolve these errors?

demon-kr.github.io/:1 Failed to find a valid digest in the 'integrity' attribute for resource 'https://demon-kr.github.io/js/bundle.min.d751e63c00e1161a75e60eaf823256097427a013523377fb636f7605271f62a5.js' with computed SHA-256 integrity 'xg27Qi7QU7B2EWDjo/CLmvIGDwCtyPEsD/IajPVbPY4='. The resource has been blocked.
@dhje0ng
Copy link
Author

dhje0ng commented Feb 29, 2024

This works fine if you change the following line to "" in themes/gokarna/layouts/partials/head.html.

My guess is that the integrity is not matching before and after the build.

<script src="{{ $jsBundle.RelPermalink }}" integrity=""></script>

@526avijitgupta
Copy link
Member

Hi @dhje0ng thanks for reporting the issue.

Referencing the stack overflow post about the error, it seems like the integrity match could be failing due to Cloudfare config (see top voted answer).

We could make the integrity value as "" as a workaround but I'm not in favour of that since it would mean opening ourselves up for potential security vulnerabilities where the external resources could have changed.

I know this issue is resolved for you but would you mind checking if you have "Auto Minify" turned on if you're using Cloudfare (or any other provider)?

cc @yashmehrotra

@dhje0ng
Copy link
Author

dhje0ng commented Mar 22, 2024

Hi @526avijitgupta

I'm deploying from Github Blog itself, without any external provider. Does this have anything to do with the HTTPS option provided by Github?

@mansoorbarri
Copy link
Contributor

in my experience, this happens because the service providers keep a cache of the files including CSS files. This happens on Github pages as well; try clearing the cache and see if it helps.

@dhje0ng
Copy link
Author

dhje0ng commented Apr 22, 2024

image image image

@526avijitgupta @mansoorbarri

DNS for my domain is Cloudflare. I tried disabling options related to optimisation or minification here and clearing the cache, but this did not solve the problem.

So far, there doesn't seem to be a better workaround for me other than patching the code with JS Integrity=""

If you have a specific workaround for these issues, could you please reply?

@jamesericdavidson
Copy link
Contributor

@526avijitgupta @yashmehrotra Should we add this to the Docs and close the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants