Skip to content

Blazor WebAssembly lazy loading assemblies not working when using @ref attribute in the component #29342

@ajithr

Description

@ajithr

Describe the bug

  • When using Blazor WebAssembly lazy loading assemblies with component's @ref attribute, the corresponding assembly could not load issue throws in the browser console and the application not running.

To Reproduce

https://github.com/ajithr/blazor-wasm-lazy-ref

  • Check out the above repo and open ~/LazyLoadingRef/LazyLoadingRef.csproj file in the VS 2019.
  • Run the application it will throw exceptions in the browser console.
  • Open ~/LazyLoadingRef/Pages/Counter.razor file and remove @ref attribute and LazyLoadComponent reference in the @code section.
  • Run the sample again and it will work properly with the lazy loading feature.
    image

Exceptions (if any)

image

Further technical details

  • ASP.NET Core version - .net5.0

  • Include the output of dotnet --info
    image

  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
    image

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-fewThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-blazor-builtin-componentsFeatures related to the built in components we ship or could ship in the futurefeature-blazor-lazy-loadingIssues related to adding support for lazy-loading in Blazorfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyseverity-majorThis label is used by an internal tool

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions