aspnetcore: Failed to find a valid digest in the 'integrity' attribute for resource Blazor Wasm

Can anyone publish a new blazor wasm app and publish it to a domain successfully? I’m publishing within VS 2022 via FTP directly to my domain (not using CLI).

Fails: .Net 6 blazor wasm app (vs2022) throws errors: https://bugmonitor.com/blazor/ http://bugmonitor.com/blazor/

I’m getting: Uncaught TypeError: Cannot read properties of undefined (reading ‘register’) at index.html:26 index.html:1 Failed to find a valid digest in the ‘integrity’ attribute for resource ‘http://bugmonitor.com/blazor/wwwroot/_framework/dotnet.6.0.0.7vke5xwy70.js’ with computed SHA-256 integrity ‘6+0cHoWrocTZHsJlI4Vt1HRaRoOkZ5m6QDd36EAAHxc=’. The resource has been blocked.

Line 26 is the service-worker.js file which gets read, then blocked using https, but loads via http (looking at network files in F12/dev browser tools).

For reference, here’s the page:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>BlazorApp3</title>
    <base href="./" />
    <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <link href="css/app.css" rel="stylesheet" />
    <link href="BlazorApp3.styles.css" rel="stylesheet" />
    <link href="manifest.json" rel="manifest" />
    <link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
    <link rel="apple-touch-icon" sizes="192x192" href="icon-192.png" />
</head>

<body>
    <div id="app">Loading...</div>

    <div id="blazor-error-ui">
        An unhandled error has occurred.
        <a href="" class="reload">Reload</a>
        <a class="dismiss">🗙</a>
    </div>
    <script src="_framework/blazor.webassembly.js"></script>
    <script>navigator.serviceWorker.register('service-worker.js');</script>
</body>

</html>

Works: .Net 5 blazor wasm app (vs2019) on same domain works with https or http: https://bugmonitor.com/mysleep http://bugmonitor.com/mysleep

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 28 (12 by maintainers)

Most upvoted comments

So publishing to prod from VS results in a working app, but publishing to prod from IIS Web App Deploy results in integrity check failures?

Correct. Yes, I’ve viewed the page, but have not ran the script yet. I plan to do that tomorrow.