Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question Updating Modal 4.1.0 to 5.0.1

See original GitHub issue

I am trying to update Blazor.Server Blazored.Modal from version 4.1.0 to the new version 5.0.1 and it is beating me up. The 4.1.0 version works perfectly though. If I add your CascadingBlazoredModal component as you request when the application starts it crashes on the <app> line in the _Host.cshtml below with a error of “InvalidOperationException: Blazored.Modal.BlazoredModal requires a cascading parameter of type IModalService”. Is there an issue with having two components wrapping the router in the App.razor file? How do I get around this issue?

The App.razor page already has a “CascadingAuthenticationState” component wrapping the router and has some additional parameters the application needs that are stored in your loacalStorage component.

`@code{ [Parameter] public string UserAgent { get; set; } [Parameter] public string IPAddress { get; set; } [Parameter] public string ServerUrl { get; set; }

protected override async Task OnAfterRenderAsync(bool firstRender)
    if (firstRender)
        await localStorage.SetItemAsync("UserAgent", UserAgent);
        await localStorage.SetItemAsync("IPAddress", IPAddress);
        await localStorage.SetItemAsync("ServerUrl", ServerUrl);

} ` And then the _Host.cshtml has some code like below inside the body tags:

<app> <component type="typeof(App)" render-mode="ServerPrerendered" param-UserAgent="@Model.UserAgent" param-IPAddress="@Model.IPAddress" param-ServerUrl="@Model.ServerUrl" /> </app>


Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

Webreapercommented, Jul 16, 2020

Might not be related to your problem, but check if you have removed the leftover <BlazoredModal/> from <MainLayout> component.

This fixed it for me.

nyashcommented, Jul 16, 2020



Might not be related to your problem, but check if you have removed the leftover <BlazoredModal/> from <MainLayout> component.

After upgrade to the new version I have added the new <CascadingBlazoredModal/> to App.razor wrapping the router and got tripped by this (App would crash (js interop excepctions), or double Modals would appear).

Read more comments on GitHub >

github_iconTop Results From Across the Web

c++ - Assimp update to 5.0.1 issue with bone mname and ...
I downloaded assimp 4.1.0, recompiled / linked, and now it's working. I probably just built and linked 5.0.1 wrong. I'll leave the question...
Read more >
Modal · Bootstrap v5.1
Use Bootstrap's JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
Read more >
Upgrading your build from Gradle 4.x to 5.0
This chapter provides the information you need to migrate your older Gradle 4.x builds to Gradle 5.0. In most cases, you will need...
Read more >
Google Play Billing Library release notes
1 of the Google Play Billing Library and Kotlin extensions are now available. Summary of changes. Update Play Billing Library to be compatible...
Read more >
OOS 4.1.0 (7.1.1) Consolidated Issues
Issues persistent and specific to 4.1.0 update. ... Hotspot connectivity - Connected but no Internet issue. ... It's not a sustainable business model....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found