Hasse Jansson
Hasse Jansson

Reputation: 41

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

I have just created a hosted blazor webassembly pwa project, which generates client, server and shared projects, all fine. I start the solution and everything runs fine.

But after I start to add small changes to the projects it stops working with a message like this:

"Failed to find a valid digest in the 'integrity' attribute for resource '' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked."

I search the net and stack overflow and find others having almost the same problem. Some can do clean and rebuild to solve this, but that's not working for me.

So, what is this? Why is this happening, totally useless?

Is it the PWA feature? Should I create a new solution without the pwa enabled?

Upvotes: 0

Views: 11878

Answers (1)

MauOnStckOvf
MauOnStckOvf

Reputation: 21

It started happening to me recently. Only on a published released solution. Not on local debug.

Clean+rebuild didn't work for me. I had to delete bin and obj folders from both Client and Server (note: tried client only and, it did not work but, did not try server only) then republish.

cf. Failed to find a valid digest in the 'integrity' attribute for resource in Blazor app

It now occurs each time I upgrade or downgrade a package.

I've done several tests and can confirm :

DLL are the right ones (SHA256 hash validated) on the server. the string in the blazor.publish.boot.json is the right ones. I was even able to get rid of the problem by reverting to the previous package version prior to the bug (which changes back the related entry in blazor.publish.boot.json). Which for me confirms a reference is not updated somewhere.

The only significant changes I've made recently are switching to VS2022 and .NET6. The bug appeared after I did my first successful publish on Azure through VS2022: 1st package upgrade after that triggered the bug.

Upvotes: 1

Related Questions