Skip to content

Unintentional change to Blazor WebAssembly startup promise semantics #31971

Closed
@SteveSandersonMS

Description

@SteveSandersonMS

Follow-up from #31769 (review)

It looks like an unintended consequence of #31769 was changing the behavior of the promise we return from Blazor.start:

  • On Blazor Server, Blazor.start returns a promise that resolves when the .NET code starts up and the app becomes interactive
  • On WebAssembly:
    • Prior to this PR, Blazor.start behaves the same as server (the promise resolves when the app becomes interactive)
    • Since this PR, Blazor.start returns a promise that doesn’t resolve until the .NET app exits, which typically means never, and hence prevents its usage for triggering post-.NET startup logic

The fault here is not in the PR, but is with us not previously having added any E2E coverage for this behavior on WebAssembly (though we do have coverage for it on Server).

Ideally we should fix this before preview 4 ships.

Possible fix

The absolute simplest thing to do would be just removing the await keyword from the line where we call platform.callEntryPoint. Going further, it would be great to also add an E2E test for this behavior on WebAssembly.

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-blazor-boot-upfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssembly

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions