There are number of questions about the same issue, but the solutions to those are specific to IIS: we are hosting in Azure Web App Linux instance and are using Kestrel (ASP.Net Core 3.1) as the web server.
After setting up Angular PWA and deploying a new release, the Angular client throws the following message;
manifest.webmanifest:1 Manifest: Line: 1, column: 1, Syntax error.
Commonly this error is shown when the manifest.webmanifest cannot be loaded (the current version I am testing is the default file that was installed by Angular PWA so its content is unlikely to be the issue). Also, when in Chrome Developer tools I review the file, it will show the content of my index.html
.
Following instructions for IIS, I tried to find out how to serve the file using Kestrel. Ben's answer suggests the following (I also tried application/json
):
FileExtensionContentTypeProvider provider = new FileExtensionContentTypeProvider();
provider.Mappings[".webmanifest"] = "application/manifest+json";
app.UseStaticFiles(new StaticFileOptions()
{
ContentTypeProvider = provider
});
How can we serve the Angular PWA from Azure Web Service (Linux)?