dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.26k stars 9.96k forks source link

InteractiveAutoRenderMode(prerender:false)) does not use interactive server rendering #54657

Open ihorlazarenko opened 6 months ago

ihorlazarenko commented 6 months ago

Is there an existing issue for this?

Describe the bug

When InteractiveAuto render mode is used without prerendering, server rending is not started and Blazor hangs until wasm dlls are loaded.

Expected Behavior

When Blazor webassembly cache is empty server rendering should start no matter whether prerender is enabled or not.

Steps To Reproduce

  1. Create Blazor project with Auto interactive render mode from template(interactive location per component).
  2. Change render mode in Counter.razor to @rendermode @(new InteractiveAutoRenderMode(prerender:false))
  3. build run
  4. Change network latency in browser developer mode to Slow 3G or smth slow and clear Blazor cache dlls
  5. Open Counter page and see that page is empty and Blazor does not use server rendering and only load dlls 2024-03-21_03-34-42

Exceptions (if any)

No response

.NET Version

8.0.203

Anything else?

No response

chadwickposey commented 4 months ago

In OP description, they mention "When InteractiveAuto render mode is used without prerendering, server rending is not started and Blazor hangs until wasm dlls are loaded." In our case, Blazor just hangs and never completes the load. It loads all the assemblies, but the page is never rendered. If you refresh the browser, then (because the wasm assemblies are already downloaded maybe?) it renders the page properly. We are using Microsoft.AspNetCore.Components.WebAssembly 8.0.1 on the client side and Microsoft.AspNetCore.Components.WebAssembly.Server 8.0.1 on the server side, and the same directive for the components: InteractiveAutoRenderMode(prerender:false)

mcse3010 commented 4 months ago

Updated both client and server to 8.0.5, and the problem still persists.