-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blazor Hot Reload: MatBlazor Button breaks Hot reload in Dotnet 6 preview 3. #51126
Comments
It is not worked for me also and checked my network it is missing downloading of 127.0.0.1 websocket, connection. |
@MRakesh Okey, are you sure it works? Have you tried restarting the dotnet watch?
|
FYI @lambdageek |
Haven't tried running the repro yet, but looking at the source for MatButton, I see it has a |
Love the hot reload functionality, but the fact that RenderFragment parameters are not working yet is a huge bummer (I understand it's in preview though, of course). |
Yes, the goal overall is to get to a point where:
At the moment MonoVM and Roslyn aren't yet on the same page about what's supported. (Partly because we are working on expanding what Mono can do. The Roslyn team would have to do some work to reliably detect and report rude edits, only to undo that work in the next release.) I realize that leaves folks trying it out now in a quite painful situation in the meantime, please bear with us. |
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsDescribe the bugHello! To ReproduceI've created a repo https://github.com/vallgrenerik/HotReloadTest Uncomment the button to make it crash. Exceptions (if any)The crash appears in the browser console like this:
Full crash:
Further technical details
|
Tagging subscribers to this area: @thaystg Issue DetailsDescribe the bugHello! To ReproduceI've created a repo https://github.com/vallgrenerik/HotReloadTest Uncomment the button to make it crash. Exceptions (if any)The crash appears in the browser console like this:
Full crash:
Further technical details
|
AntDesign also crash. In fact, I guess any third-party UI framework will cause this problem. Hotreload worked well when I create a new project, but it carshed when I import AntDesign. |
I am a member of AntDesign. I just run my own tests and in my case I did not experience crashes. In my case best Hot Reload experience is with server-side. My changes were immediately applied. In case of wasm - if I had any component of AntDesign in my razor file, the changes I was making were not applied. I had to press Ctrl+R, then they were applied. If I commented out AntDesign component - changes were applied. I also created a basic razor library to have comparison - and basic library changes are reflected. One curious scenario - when AntDesign component was already added, on first run when I commented it out, hot reload was kicking in and the component was removed from DOM. Uncommenting had no effect - it was not added again. If on the first run I made any other change (either to the AntDesign component or for example just added a text), hot reload was not working. Then removing AntDesign component had no effect either. Eventually I replaced AntDesign nuget with direct reference to AntDesing project. I upgraded it to net6 but it had no effect. <TargetFrameworks>netstandard2.1;net5;net6</TargetFrameworks> with this <TargetFramework>net6</TargetFramework> and hot reload started working. Of course I had to also comment out couple of |
My TargetFramework is
If I remove AntDesign, hotreload works again. @anddrzejb I guess wasm hotreload is not support well. |
@dicarne You are right. Somehow I missed the exceptions in the browser... |
@anddrzejb @dicarne Blazor server-side and browser have different hot reload capabilities - currently there are more limitations on the browser side. For the .NET 6 release, we're working to bring the WebAssembly hot reload closer to the capabilities of Blazor on the server, and to improve diagnostics so that the app falls back to restarting if we cannot hot reload the code on the browser. |
Thanks @lambdageek. To chime in, our approach here is multi-fold a) WebAssembly's hot reload capabilities should improve over time. Simultaneously the compiler is adding support to allow more kinds of edit to be made. |
I do remember from the blog post that wasm experience is behind in comparison to server-side. I wanted also to emphasize that in server-side it seems that hot reload is not working for libraries that target multiple frameworks. |
@pranavkm is there an issue already for this ^^^ ? |
@anddrzejb could you file a separate issue for this in https://github.com/dotnet/aspnetcore possibly with a minimal app that reproduces the problem? We haven't tested this particular scenario but it's surprising to know that multi-targeting affects this. |
Sure, I will try to prep something. I think that is the problem - once I removed multitargeting from AntDesign, hot reload started to work. When I reversed it - it stopped working. Edit: Created issue #52073 |
@lambdageek what is the status of this? |
This issue is essentially a duplicate of #50249 at this point.
That means editing a page that has existing MatBlazor buttons should work
Adding new MatBlazor buttons will be a rude edit in .net 6 and will cause the blazor webassembly app to ask to restart. |
The initial support for hot reload edits that add new lambdas has been added (#63513). It should be available in the first .NET 7 preview. |
Thanks for the update @lambdageek |
@vallgrenerik I'd prefer to keep it open until a preview is out and I can verify that it's working. |
@lambdageek, I tested in 7 preview 4 - it does not crash, hot reload with the button works. I am closing. |
Describe the bug
Hello!
First: Thanks for fantastic work with Hot reload. It looks promising!
But unfortunately a MatBlazor (https://www.matblazor.com/) button "MatButton" makes the hot reload crash.
To Reproduce
I've created a repo https://github.com/vallgrenerik/HotReloadTest
(A simple Blazor WASM ASP.Core Hosted)
Look inside the Index.razor in the .Client project.
Uncomment the button to make it crash.
Comment out the MatButton, press CTRL + R in terminal to force reload and the Hot reload works again.
Exceptions (if any)
The crash appears in the browser console like this:
Full crash:
Further technical details
Version 16.10.0 Preview 1.0
The text was updated successfully, but these errors were encountered: