MudBlazor / Templates

Ready to use Blazor Templates in different styles and layout with all the basic setup already done for MudBlazor.
MIT License
745 stars 165 forks source link

error when use .net 8 template with interactive render auto #453

Closed marceloperegil closed 8 months ago

marceloperegil commented 10 months ago

Steps to reproduce error:

  1. install template with the command: dotnet new mudblazor --interactivity Auto
  2. run the proyect
  3. go to counter page
  4. click on counter button
  5. refresh the page
  6. get the error image
ScarletKuro commented 10 months ago

@mikes-gh isn't the problem related because the template is using rc libs. I'm slightly surprised it went like this in prod

mikes-gh commented 10 months ago

I did ask for them to be updated :-( But thats not the problem in this case cause I updated them to 8.0.1 and the problem remains edit it is the problem

mikes-gh commented 10 months ago

@ScarletKuro You are right. After a clean and rebuild with 8.0.1 the issue is resolved

JarFrank commented 10 months ago

I had to also clean obj and bin folders

marceloperegil commented 10 months ago

https://github.com/MudBlazor/Templates/issues/453#issuecomment-1901309111 This worked for me.

philipp-koch commented 9 months ago

I am seeing the same error as initially described. Cleaning and rebuilding does not fix it for me. Also, I see it in every single, freshly created MudBlazor project. Here's what I did:

Once it's created, I change nothing at all and start debugging (F5):

grafik (Also, the CSS file gets a 404 now).

To rule out a configuration problem, I have uninstalled .NET entirely and made a clean install. I did the same with Visual Studio (removed completely and did a clean install). It changed nothing. I've used MudBlazor with .NET 6 and never experienced any problems like this.

Also, when using the "original" Blazor Web App template that comes with Visual Studio, applying the same settings as above, it works without a problem, no matter how often I reload / restart. The same goes for the Fluent UI template: It works both server side as well as after the switch to client side - so clearly, there's an issue with MudBlazor somehow...

My impression is that something goes/is wrong with the way WebAssembly render mode is configured/hooked in (since the problem occurs after the first reload, i.e. after the switch from server side to client side. Sadly, I cound't figure out what "the other" templates (the "original" one or Fluent UI) do differently regarding this...

I do think that MudBlazor is fantastic, and I'd really, really love to use this rather than Bootstrap (oiriginal template) or Fluent UI. So - how could this problem best be tackled?

Thanks to everybody investing tehir time to work on MudBlazor and to help other people!

ScarletKuro commented 9 months ago

@philipp-koch have you updated the underlying libraries (Microsoft.AspNetCore.Components.WebAssembly.Server, Microsoft.AspNetCore.Components.WebAssembly and all other MS libraries) to 8.0.1 as the issue suggests? Then clear obj / bin / .vs(hidden) folders, clean browser cache etc.

philipp-koch commented 9 months ago

@ScarletKuro Thank you for pointing this out so clearly - I was mistaken, thinking "8.0.1" referred to the installed .NET SDK! So, I've taken a look at the NuGet package manager, and indeed the mentioned packages were still the RC versions, not 8.0.1. I have updated them, performed clean and rebuild for the solution, cleared the browser cache - and voilà, it works now! So, in other words: "Amazing, just do it right and all of a sudden it works!" (Kaum macht man's richtig, schon funktioniert's...) 🤣

I'm a little embarassed now, but more importantly, I'm really happy this could be solved (so easily)...

Thanks for your quick and helpful reply!

ScarletKuro commented 9 months ago

Hopefully https://github.com/MudBlazor/Templates/pull/454 will be merged soon, so it will work out of the box.