Skip to content

fix: System.ArgumentException: The renderer does not have a component with ID 48. in Blazor Web App template #3068

@frindler

Description

@frindler

🐛 Bug Report

When the stream render update on the Weather page of the FluentUI template is pushed, the template crashes.

💻 Repro or Code Sample

  • dotnet new fluentblazor -o FluentUIBlazorTest

  • Add @using Icons = Microsoft.FluentUI.AspNetCore.Components.Icons to _Imports.razor as per Upgrade Guide for v4.11.0.

  • cd FluentUIBlazorTest && dotnet run.

Then go to the Weather page on the app running in the browser.

🤔 Expected Behavior

After the "Loading..." disappears, it is replaced with the weather forecast data.

😯 Current Behavior

Crashes. It shows:

System.ArgumentException: The renderer does not have a component with ID 48.
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetRequiredComponentState(Int32 componentId)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetComponentState(Int32 componentId)
   at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.GetComponentDepth(Int32 componentId)
   at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.SendBatchAsStreamingUpdate(RenderBatch& renderBatch, TextWriter writer)
   at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.UpdateDisplayAsync(RenderBatch& renderBatch)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Components.HtmlRendering.Infrastructure.StaticHtmlRenderer.HandleException(Exception exception)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessPendingRender()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderHandle.Render(RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
   at Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
   at Microsoft.AspNetCore.Components.HtmlRendering.Infrastructure.StaticHtmlRenderer.HandleException(Exception exception)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.HandleExceptionViaErrorBoundary(Exception error, ComponentState errorSourceOrNull)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.<WaitForQuiescence>g__ProcessAsynchronousWork|54_0()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.WaitForQuiescence()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderRootComponentAsync(Int32 componentId, ParameterView initialParameters)
   at Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer.SendStreamingUpdatesAsync(HttpContext httpContext, Task untilTaskCompleted, TextWriter writer)

🌍 Your Environment

  • OS & Device: macOS
  • Browser: Google Chrome
  • .NET and Fluent UI Blazor library Version: .NET 9, FluentUI Blazor 4.11.0+a6773274

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions