Coder Social home page Coder Social logo

Comments (13)

under3415 avatar under3415 commented on May 20, 2024 3

Going back to 1.0.33 fixed the issue, it's working again!

from webessentials.aspnetcore.serviceworker.

bpepe avatar bpepe commented on May 20, 2024 1

Same problem here. I believe the 'Update Constants.cs #29' commit is the issue.

from webessentials.aspnetcore.serviceworker.

jpisano avatar jpisano commented on May 20, 2024 1

I know it's not ideal but if you disable registering both the service worker and manifest:

services.AddProgressiveWebApp(new PwaOptions
{
	RegisterServiceWorker = false,
	RegisterWebmanifest = false,
	OfflineRoute = "offline"
});

You can then manually add both back to your layout:

<meta name="theme-color" content="#FFFFFF" />
<link rel="manifest" href="/manifest.webmanifest" />

and

<script>'serviceWorker' in navigator && navigator.serviceWorker.register('/serviceworker')</script>

from webessentials.aspnetcore.serviceworker.

HaraldMuehlhoffCC avatar HaraldMuehlhoffCC commented on May 20, 2024

Same problem here. Going back to 1.0.33 fixed the issue for me also.

from webessentials.aspnetcore.serviceworker.

TanmaySM avatar TanmaySM commented on May 20, 2024

Facing same issue. Using other way around by setting RegisterServiceWorker and RegisterWebmanifest to false and adding both file manually as mentioned by @jpisano

from webessentials.aspnetcore.serviceworker.

JudahGabriel avatar JudahGabriel commented on May 20, 2024

@madskristensen It appears the latest WebEssentials.AspNetCore.SPA NuGet package doesn't work with .NET Core 2.1 because of the tilde, as described in the first post in this thread.

from webessentials.aspnetcore.serviceworker.

acr21 avatar acr21 commented on May 20, 2024

Having the same issue.

from webessentials.aspnetcore.serviceworker.

braegelno5 avatar braegelno5 commented on May 20, 2024

the last nuget package Version=1.0.42.0 has also again this error the master branch source are
public const string ServiceworkerRoute = "/serviceworker";
the reflected one is "~/serviceworker" with dll Version=1.0.42.0

from webessentials.aspnetcore.serviceworker.

rahulsjoshi avatar rahulsjoshi commented on May 20, 2024

Same issue with .NET Core 2.1

from webessentials.aspnetcore.serviceworker.

phiphap avatar phiphap commented on May 20, 2024

Thanks!

from webessentials.aspnetcore.serviceworker.

Ghosts avatar Ghosts commented on May 20, 2024

I was wondering if anyone has the status on this issue? Found a couple potential workarounds but if there's a plan to push a NuGet update for a fix I'd be fine waiting for that.

Thanks for any update.

from webessentials.aspnetcore.serviceworker.

scearces avatar scearces commented on May 20, 2024

from webessentials.aspnetcore.serviceworker.

GetTaxSolutions avatar GetTaxSolutions commented on May 20, 2024

May be is a similar issue and that is the reason to ask here.
I have follow code which is using RazorViewEngine to return compiled string when apply the model:

using (var output = new StringWriter())
            {
                var viewContext = new ViewContext(
                    actionContext,
                    view,
                    new ViewDataDictionary<TModel>(
                        metadataProvider: new EmptyModelMetadataProvider(),
                        modelState: new ModelStateDictionary())
                    {
                        Model = model
                    },
                    new TempDataDictionary(
                        actionContext.HttpContext,
                        _tempDataProvider),
                    output,
                    new HtmlHelperOptions());

                await view.RenderAsync(viewContext);

                return output.ToString();
            }

All parameters are correct and it is working perfect when services.AddProgressiveWebApp() is not applied. But when you add it:

Unhandled Exception: System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
at WebEssentials.AspNetCore.Pwa.ServiceWorkerTagHelperComponent.Process(TagHelperContext context, TagHelperOutput output)
at Microsoft.AspNetCore.Razor.TagHelpers.TagHelperComponent.ProcessAsync(TagHelperContext context, TagHelperOutput output)
at Microsoft.AspNetCore.Mvc.Razor.TagHelpers.TagHelperComponentTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.RunAsync(TagHelperExecutionContext executionContext)
at AspNetCore._Views__EmailLayout.ExecuteAsync()
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
at Mvc.RenderViewToString.RazorViewToStringRenderer.RenderViewToStringAsync[TModel](String viewName, TModel model) in D:\Projects\TFS\GetTaxSolutions\Tools\MailKit Client\SendMailKit\TazorToString\RazorViewToStringRenderer.cs:line 58
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Mvc.RenderViewToString.Program.Main() in D:\Projects\TFS\GetTaxSolutions\Tools\MailKit Client\SendMailKit\TazorToString\Program.cs:line 24
Press any key to continue . . .

I tried to apply PWA options to:

            RegisterServiceWorker = false,
            RegisterWebmanifest = false,

It's working but is not good solution for me. Is there some better solution to resolve this issue? Are you planning to fix it in next version?

AspNetCore version: 2.2
Pwa: 1.0.49
Thanks

from webessentials.aspnetcore.serviceworker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.