Code Monkey home page Code Monkey logo

Comments (7)

jaypalexa avatar jaypalexa commented on August 18, 2024

Oh, no. The culprit seems to be a conflict with CodeBeam.MudBlazor.Extensions. I have attached a .zip file containing a test application.

TestApp.zip

TestApp.csproj

<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="6.5.6" />

Program.cs

using MudBlazor.Extensions;
using MudBlazor.Services;
using MudExtensions.Services; // <-- hooking in CodeBeam.MudBlazor.Extensions causes the exception; comment out this line, and everything is fine

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpContextAccessor();
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddMudServices();
builder.Services.AddMudExtensions();

var app = builder.Build();
app.UseDeveloperExceptionPage();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");

app.Run();

from mudblazor.extensions.

fgilde avatar fgilde commented on August 18, 2024

I will have a look on it. Bacause of another bug i have overwritten IDialogService because MudBlazor dindtn have an accessable jsRuntime in the DialogService. Maybe i can ask them if they can add a property to get the JSRuntime.
But for your problem i hopefully find a quicker solution. As this problem also present if you continue to call InitializeMudBlazorExtensionsAsync ?

from mudblazor.extensions.

jaypalexa avatar jaypalexa commented on August 18, 2024

Thanks for having a look, absolutely not a hurry or a priority. Yes, we are still calling InitializeMudBlazorExtensionsAsync. We tried not calling it and it seemed we then needed to pass JSRuntime in the options…but I think it resulted in the same exception.

from mudblazor.extensions.

fgilde avatar fgilde commented on August 18, 2024

Problem is you didnt have called AddMudExtensions(); from my package. Becuase you have added using of CodeBeam you called the codebeam AddMudExtensions(); (Same name but different method). However to avoid this you have 2 options. You can call it without extension invocation like this

MudBlazor.Extensions.ServiceCollectionExtensions.AddMudExtensions(builder.Services);

Or you just replace the line builder.Services.AddMudServices(); with builder.Services.AddMudServicesWithExtensions();

from mudblazor.extensions.

jaypalexa avatar jaypalexa commented on August 18, 2024

Thank you! Yes, both of those options appear to work:

Option 1:

using MudBlazor.Extensions;
using MudBlazor.Services;
using MudExtensions.Services;

// this works:
builder.Services.AddMudServices();
builder.Services.AddMudExtensions();
MudBlazor.Extensions.ServiceCollectionExtensions.AddMudExtensions(builder.Services);

Option 2:

using MudBlazor.Extensions;
//using MudBlazor.Services; // <-- not needed
using MudExtensions.Services;

// this works:
builder.Services.AddMudExtensions();
builder.Services.AddMudServicesWithExtensions();

I thought we were running into an issue with Option 2 due to having a Codebeam MudSelectExtended component on the dialog, but it was because we had not included AddMudExtensions() as well as AddMudServicesWithExtensions.

(Honestly, we would prefer to use your MudExChipSelect component instead (and then we could get rid of Codebeam completely to minimize these kinds of issues), but we have run into problems being able to consistently be able to get focus into the Filter textbox...perhaps I will open another issue for that, if you are interested...I have updated the TestApp.zip to have dialogs with both components.)

TestApp.zip

Off to buy you a well-deserved cup of coffee. I very much appreciate all of your work and attention. All the best.

from mudblazor.extensions.

fgilde avatar fgilde commented on August 18, 2024

I will have a look at it. I know MudBlazor have had a bug and it was solved. You can see it here its working https://cae4f752.mudblazor-extensions.pages.dev/chip-select but now it looks like the Bug is back and now here its no more working https://www.mudex.org/chip-select. But I didnt changed anything in MudExChipSelect or dependent logic.
Maybe I need to rebuild the chipselect. However can I then close this issue? For the chip select you can create a new one.

from mudblazor.extensions.

jaypalexa avatar jaypalexa commented on August 18, 2024

Yes, sorry, of course. Closing this issue.

from mudblazor.extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.