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

Sri::hash generates wrong key #85

Closed
janlew opened this issue Jun 23, 2022 · 2 comments
Closed

Sri::hash generates wrong key #85

janlew opened this issue Jun 23, 2022 · 2 comments

Comments

@janlew
Copy link

janlew commented Jun 23, 2022

Hello, I'm started using "laravel-sri" with "laravel-mix-sri". It's working without any issues on local environment, but when I push changes on test/live I'm starting getting error messages in console:
None of the “sha256” hashes in the integrity attribute match the content of the subresource.

e.g.
example.js has hash - sha256-BxaPYc1tnHx2U8m/aKA8Sx9FEHlg6fvTDsWGCD7NGjA= in mix-sri.json
but Chrome requires whole different hash

Failed to find a valid digest in the 'integrity' attribute for resource 'xxx.com/assets/js/example.js?id=3fac7b922ddf2b2605cc177f81e781df' with computed SHA-256 integrity 'eQfO2c01V2pl0xVdxyXFNOjgpWQekJShYmr93w33pwA='. The resource has been blocked.

It looks like browser calculates different hashes, what should I do to fix this?

@alexmandrikdev
Copy link

Hello. I have the same problem.

@Elhebert
Copy link
Owner

Elhebert commented Sep 6, 2023

It seems that this would be a laravel-mix-sri issue rather that this package.
I'm not using these packages anymore, nor supporting them. Especially since Laravel works with Vite now.

Could you share the configuration for both packages? Maybe it's a configuration issue 🤔

@Elhebert Elhebert closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2024
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

3 participants