ProgressiveWebApp integration issue - ServiceProxyScript crashes 500 error
Following this link https://blog.elmah.io/turning-an-aspnet-core-website-into-a-progressive-web-app-pwa/ to add PWA feature to MVC template it crashes:
ArgumentNullException: Value cannot be null. (Parameter 'httpMethod')
Volo.Abp.Check.NotNull
changed the method CreateApiModel at AspNetCoreApiDescriptionModelProvider solved the problem: `
var model = ApplicationApiDescriptionModel.Create();
foreach (var descriptionGroupItem in _descriptionProvider.ApiDescriptionGroups.Items)
{
foreach (var apiDescription in descriptionGroupItem.Items)
{
if (!apiDescription.ActionDescriptor.IsControllerAction())
{
continue;
}
if (apiDescription.HttpMethod.IsNullOrEmpty()) apiDescription.HttpMethod = "GET";
AddApiDescriptionToModel(apiDescription, model, input);
}
}
return model;`
@maliming can you try to understand this?
@kgamalseif This is like a third-party library problem, please provide a project to reproduce the problem. You can use cli to create it. https://docs.abp.io/en/abp/latest/CLI
https://github.com/kgamalseif/PwaTest
Kindly find the above project.
to reproduce the issue, just comment line:
if (apiDescription.HttpMethod.IsNullOrEmpty()) apiDescription.HttpMethod = "GET";
at RepAspNetCoreApiDescriptionModelProvider.cs
Thanks, Khaled
hi @kgamalseif
WebEssentials.AspNetCore.ServiceWorker has fixed this problem, but it does not seem to be released to nuget.
https://github.com/madskristensen/WebEssentials.AspNetCore.ServiceWorker/pull/62