admin管理员组

文章数量:1279237

I created a Blazor Wasm standalone app + an ASP.NET Core 8 Web API with Visual Studio 2022. Both are hosted on the same server.

The app runs fine on a desktop or laptop.

But when I try to open it on mobile it fails. Load progress shows 98% and the Blazor's yellow error message at the bottom. I tried it on Android and iOS, both fails.

I searched for the error. There are many topics on it. Here Microsoft's explain the integrity check - Integrity check Here discussion about the error - integrity attribute

I tried these steps:

  • deleted bin and obj folders
  • added attributes BlazorEnableCompression and BlazorCacheBootResources
  • deleted gz and br files
  • added MIME types to web.config
  • set web application firewall to "Detection Only" in Plesk

When I compare the integrity key in the console message and in the blazor.boot.json they are different. I tried to replace the key by adding the key in the message in blazor.boot.json. It didn't help.

Any suggestions?

Updates

Continue my research.

Looks like the mobile version of browsers compresses the files and they have other hash.

I calculated sha-256 hash of icudt_CJK.dat file and it's the same as in blazor.boot.json (ending ...Hk=). At the same time, the console log shows another hash (ending ...FU=).

I added <EmccMaximumHeapSize>268435456</EmccMaximumHeapSize> directive to the project file. This tag decreases the maximum memory for the app on mobile device browsers. Didn't help.

Then I tried AOT compilation <RunAOTCompilation>true</RunAOTCompilation>. It took much longer to compile the project. Didn't help.

When I set <BlazorCacheBootResources>false</BlazorCacheBootResources> the site doesn't work on both - desktop and mobile platforms.

I get same error

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

Uploaded the test project on another hosting, and it doesn't work on both - desktop and mobile.

本文标签: aspnet core webapiIntegrity check fails on mobile platforms in Blazor Wasm AppStack Overflow