jsakamoto / Toolbelt.Blazor.HeadElement

Head element support (change the document title, "meta" elements such as OGP, and "link" elements) for Blazor apps.
https://demo-blazor-headelement.azurewebsites.net/
Mozilla Public License 2.0
158 stars 11 forks source link

Cannot process pending renders after the renderer has been disposed. #6

Open vd3d opened 4 years ago

vd3d commented 4 years ago

Hi,

I got an error : Cannot process pending renders after the renderer has been disposed.

It is when I start the application.

I noticed that if I only use the "Title" tag, it works.

Stack trace

at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessPendingRender() at Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment) at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged() at MyApp.Web.Shared.Application.ApplicationBar.d__21.MoveNext() in C:\MyApp\Web\Shared\Application\ApplicationBar.razor:line 486

Some code

Really nothing special... but

context.Services.AddHeadElementHelper();
app.UseHeadElementServerPrerendering();
<Meta Property="ogp:url" Content="https://www.socloze.com"/>
<Meta Property="ogp:type" Content="website"/>
<Meta Property="ogp:title" Content="SoCloze"/>
<Meta Property="ogp:image" Content="https://www.socloze.com/images/logo!40.png"/>
<Meta Property="og:site_name" Content="SoCloze"/>
<Meta Name="robots" Content="noimageindex, noarchive"/>
<Meta Name="apple-mobile-web-app-status-bar-style" Content="default"/>
<Meta Name="mobile-web-app-capable" Content="yes"/>
<Meta Name="theme-color" Content="#ffffff"/>
<Meta Property="application-name" Name="SoCloze"/>
<Meta Property="description" Name="description" Content="Find products nearby your location and ideas on SoCloze" data-app="true"/>
<Meta Property="og:description" Name="og:description" Content="Find products nearby your location and ideas on SoCloze" data-app="true"/>
vd3d commented 4 years ago

It is because of the data-app="true" !

jsakamoto commented 4 years ago

@vd3d Could you tell me why you need to add the attribute "data-app=true" into the "meta" tag?

Adding support to accept any attributes is very hard work because this is NOT a simple Blazor component but to save, transfer, and restore complex information between server and clients.

Therefore, I want to know how important adding support to accept the attribute "data-app=true".