I want to have an app that has a part which also must function offline.
So my thought was to create a Blazor Web App (.NET 10) with WebAssembly Interactive render mode and implement the PWA part there.
Regarding the .NET Templates there is only the option for "PWA" when creating a Blazor WebAssembly Standalone App and not when creating a Blazor Web App.
So I tried to create a Blazor Web App with global WebAssembly Interactivity render mode and then add the part for PWA into the Client Project (which is a WebAssembly project) using the manual from Microsoft to Convert an existing Blazor WebAssembly app into a PWA
When I deploy this and access the site, the service worker install will fail with following message (replaced domain name):
Failed to find a valid digest in the 'integrity' attribute for resource 'https://<my domain>/PWATest.Client.styles.css' with computed SHA-256 integrity '<every page load a different hash>'. The resource has been blocked.Understand this errorFetch API cannot load https://<my domain>/PWATest.Client.styles.css. SRI's integrity checks failed.Understand this errorservice-worker.js:28 Uncaught (in promise) TypeError: Failed to fetch. SRI's integrity checks failed. at service-worker.js:28:54 at async onInstall (service-worker.js:28:5)In the service-worker-assets.js there is the file PWATest.Client.styles.css listed. But in the published wwwroot there are only the fingerprinted files: PWATest.Client.ndeuygvo4f.bundle.scp.css
So what am I doing wrong here?
And maybe there is a better solution to achieve what I am needing. Then please don't hesitate to give me advice.
I need an application which basically runs online (data has to be fetched from server/database etc.), but it must have the possibility to function offline in parts. A user will go with tablet to areas where there is no internet and must have the possibility to fill out forms (which would then be synchronized when online again).And I want to use Blazor.