-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Hot reloading fails after the second change of a razor file #59027
Comments
@tmat Is this a known issue? Also, in which repo should this be tracked? |
@akorchev Could you please run |
Here is the complete output until the error:
|
@danroth27 wrote
There are a number of similar issues open in the SDK repo. |
@willdean Can you share the issue links? |
Here's mine which doesn't sound exactly like the above, but people have added comments that do: Here's another which is more like mine: dotnet/sdk#44910 Here;'s one which references Blazor: dotnet/sdk#44384 |
Looks like this is a general problem when the WASM runtime is not loaded yet when dotnet-watch tries to connect to the browser:
Doesn't seem like a regression. I don't think this ever worked reliably. Will need to figure out what to do about it. |
I am also having this issue and I find it interesting that your terminal shows "building..." on app start, mine doesn't. |
Here are a few more tests that I conducted. .NET 8 Blazor app with Auto interactivityI tested an existing .NET 8 app created long before installing .NET 9 ( Adding a global.json with the following content solves the problem completely:
I can update Home.razor many times and the error does not appear. .NET 9 Blazor app with Server interactivityI then created a server interactivity app to eliminate issues related to WASM runtime loading. To do that I used
.NET 9 Blazor app without interactivityThen I created a Blazor app without interactivity via Those tests made me think that:
For completeness purposes I tested on a different Mac with the same results. Also tried with different browsers - the results were the same. |
@tmat This issue also reproduces in the latest 10.0 Preview 1 SDK on Linux/Mac OS. We have a known issue [#3202] that has been fixed in the old 10.0 Preview 1 SDK version [detail info]. |
fwiw, I had similar issues on Ubuntu 20.04 using a .net 9 version I built from source several weeks ago. It happened on a Blazor project that does not use WASM, just Blazor Server with HTMX on the client. Kept running into "Change failed to apply (error code: '...')..." messages. I know Ubuntu 20 is not supported on dotnet 9, and thought maybe it's something just on my environment, but now I see that it's in other platforms as well |
I'm running Ubuntu 24.04 with the latest .NET 9.0 version and am facing the exact same issues |
Same issue here on MacOS 14.5 with .NET 9. |
@tmat because the fixes will be in the dotnet/sdk repo, should we move this to the sdk repo too? |
@mkArtakMSFT I don't think it matters, but if you'd like to move it go ahead. |
Very concerned to see this marked as planned for .NET 10. Is there an appreciation within MS that, for some of us, Even the simplest (I know hot reload is not simple at all, but it used to work) stuff, like adding a class name to an element on a Blazor Server (i.e. no WASM magic) project, is now not reliably carried through to the browser. Sometimes DNW thinks there are no updates though there are, sometimes other compiler errors appear (e.g. suddenly starts thinking that components are elements and warning about that), sometimes it does update but much slower than 8.0. Sometimes the code updates but the browser has to be refreshed by hand. Using I hoped that maybe @danroth27 had a grip on this as someone who must appreciate that the hot-reload story is utterly vital to Blazor's success, but when I see "Net 10 Planning" appear as a milestone I wonder if we're going to have to skip an entire release cycle. |
@willdean Should be in 9.0.x. Working on a fix already. |
Is there an existing issue for this?
Describe the bug
Making a change to a .razor file no longer applies consistently after upgrading to .NET 9. I am using macOS 15.0.1 on a MacBook Pro M1 (could be related).
Expected Behavior
All changes should be hot-reloaded, not just the first one. This used to work in .NET 8.
Steps To Reproduce
dotnet new blazor -int Auto -o Blazor9Auto
in some directory (from command prompt).dotnet watch --project Blazor9Auto/Blazor9Auto.csproj
This should open the browser.Exceptions (if any)
Change failed to apply (error code: '00-00-00-00-00'). Further changes won't be applied to this process.
.NET Version
9.0.100
Anything else?
ASP.NET Core version:
9.0.0
The IDE (VS / VS Code/ VS4Mac) you're running on, and its version:
Tested with VS Code, vim. The editor doesn't seem to matter.
Include the output of dotnet --info:
The text was updated successfully, but these errors were encountered: