
This is part 2 in a series of posts based on my recent work to introduce PWA technology into the enterprise.
PWA GitHub repo setup
To use a more meaningful and inclusive default initial branch name outlined here, I use the following command to change it to main:
|
Then, I fire up Windows Terminal in my workspace folder:
|
Login to GitHub.com
Create a new repository for MyPWA project
Copy repo SSH
|
OR
Login to https://dev.azure.com/YourCompanyHere
Create a new project for MyPWA project Click Advanced Select Git from Version Control Click Create

After the set-up has finished, click on Repositories, copy the HTTPS URL and use the same command as above:
|
Copy repo SSH
|
Persistent Storage
https://web.dev/persistent-storage/#chrome-and-other-chromium-based-browsers
Manifest file with webmanifest extension
Trying to do things the “right” way developing the PWA, I amended the manifest file to use the .webmanifest file extension:





Gotchas
“Failed to read parameter” “from the request body as JSON” (https://stackoverflow.com/questions/53156334/api-controller-unable-to-read-json-from-post-body) Basically, one needs to check and ensure that the JSON that you POST is valid for the target object to which you are deserializing it. If you have non-nullable properties for which the value sent in JSON is null, then your deserialization will fail (without telling you why). Hope this helps.
Recreate issue to see DevTools showing number to string error
“Uncaught (in promise) TypeError: Failed to execute ‘Cache’ on ‘addAll’: Request failed” MDN You get this exception when any files which you have mentioned in Basically, any file requests that return a 404 response (cannot be found) will cause this error.
“Failed to find a default file in the app artifacts folder (/). Valid default files: index.html,Index.html.” SWA Build error. Move index.html back to the root.

Favicon.ico file must be in the root folder.
Service worker file cache listing needs each file, not just the parent folder (no wildcards) - a good explanation o Stackoverflow