Skip to content

Setting rendermode to InteractiveAuto does not use Interactive Server rendering #63596

@pushmlk

Description

@pushmlk

Is there an existing issue for this?

  • I have searched the existing issues

This issue is similar to another github issue that was closed without a resolution (link)

Describe the bug

This issue has two parts:

  1. When InteractiveAuto render mode is used with prerendering, the page first renders with Static Server rendering and then, as soon as the WASM is loaded, it switches to Interactive WebAssembly rendering.
    It does not switch to Interactive Server rendering while the WASM is loading.
    This results in a degraded user experience as, after the page loads, it is not interactive for a few seconds until the WASM is loaded.
    I'm displaying @RendererInfo.Name on the page to determine which renderer is being used.

  2. When InteractiveAuto render mode is used without prerendering, the page takes a few seconds to load, and
    loads with Interactive WebAssembly rendering.

In both cases, It looks like the page never switches to Interactive Server rendering.

In case this helps - when a page with InteractiveAuto render mode is loaded on FireFox with WASM support turned off, the page loads with Static Server rendering and does not switch to Interactive Server rendering.

Expected Behavior

  1. When InteractiveAuto render mode is used with prerendering, the page should:
    1. first render with Static Server rendering, and then
    2. quickly switch to Interactive Server rendering (and become interactive), and the finally
    3. switch to Interactive WebAssembly rendering after the WASM is loaded.
  2. When InteractiveAuto render mode is used without prerendering, the page should:
    1. load with Interactive Server rendering (and become interactive), and then
    2. switch to Interactive WebAssembly rendering after the WASM is loaded.

Steps To Reproduce

I uploaded a solution to highlight this issue (here).
The issue can be seen in the counter.razor page.

  1. Run the solution in debug mode. Refresh the counter page several times. You will see the render mode go from Static directly to WebAssembly (Issue#1).
  2. Change the render mode on the top of the page to @rendermode @(new InteractiveAutoRenderMode(prerender: false)) and run the solution in debug mode.
    Refresh the counter page several times. You will see the render mode go directly to WebAssembly without first going to Server Interactive rendering (Issue#2).

Exceptions (if any)

No response

.NET Version

10.0

Anything else?

I tested this with .NET 10.0 and Visual Studio Community 2022 (64-bit) - Preview (version 17.14.13) in debug mode;
The issue also exists in .NET 8.0 and 9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions