"Non-static method requires a target" error is thrown when navigating between pages in blazor wasm with lazy loading of assemblies #27637
Labels
area-blazor
Includes: Blazor, Razor Components
feature-blazor-wasm
This issue is related to and / or impacts Blazor WebAssembly
✔️ Resolution: Fixed
The bug or enhancement requested in this issue has been checked-in!
Describe the bug
Using lazy loading of assemblies throws an error when navigating between pages.
Additional context
A blazor wasm project is configured to use lazy loading for a class library project that has some dependencies. The app is inspired by the example from Dan Roth and the MyComponents lib. The Counter.razor page is intentionally implemented to load a separate layout page, so that the required assemblies are loaded only if this page is requested.
To Reproduce
Ctrl + F5
Note: The exact number of navigations depends on the number of components (lowering the number of components requires more navigation clicks for the error to be thrown). A more real-world scenario might be for a page to contain multiple grid components with a decent number of rows and columns, e.g. 5 grids with 20x20 cells on the same page.
Expected
No error is thrown
Actual
An exception is thrown and the app crashes
Exceptions (if any)
AN exception is thrown in the console
Further technical details
dotnet --info
The text was updated successfully, but these errors were encountered: