Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Mudblazor component appear without css?

I have installed mudblazor through NuGet and followed the "tutorial" on how to set up mudblazor, I did everything step by step but for some reason the component appears without any css or js. I had to link a css and js file in _host.cshtml:

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
    <link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
     <script src="_content/MudBlazor/MudBlazor.min.js"></script>

but the problem is that it still doesn't seem to work.

like image 464
Audrius Šaučiūnas Avatar asked May 14 '26 12:05

Audrius Šaučiūnas


1 Answers

In program.cs there is a missing instruction.

add the following line before builder.build() is called.

StaticWebAssetsLoader.UseStaticWebAssets(builder.Environment, builder.Configuration);

I spotted the discrepancy here: https://github.com/MudBlazor/Templates/blob/dev/src/.template.base/server/Program.cs#L9

like image 155
PBo Avatar answered May 16 '26 02:05

PBo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!