Can't run published Blazor WebAssembly app

Viewed 3026

The app works just fine when I run it in the Visual Studio debugger, but if I deploy it to a server I get this error in the browser console:

Failed to find a valid digest in the 'integrity' attribute for resource 'http://example.com/pwaexperiment/wwwroot/_framework/wasm/dotnet.3.2.0.js' with computed SHA-256 integrity '80L/hSwps3gjABzV78X6mehoDDgsLkm1pKpSS6fAqiE='. The resource has been blocked.

What does this error mean and how can I fix it?

3 Answers

Your server may be compressing JS files on the fly, that changes content so integrity fails. Disable compression.

Try to delete the bin and obj folders in the project. Then the compiler will rebuild the blazor.boot.json file with the new hashes. And it loads and passes the hash check on the browser.

Related