-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
The mere presence of a collocated Javascript file, e.g. "Home.razor.js" breaks Hot Reload functionality for .css files. However C# Hot Reload is not affected.
Expected Behavior
CSS Hot Reload should work.
Steps To Reproduce
- Clone the repo project. It's a fresh Blazor Web App.
- Run the project and change the color property in "Home.razor.css" to see that Hot Reload is working!
- Stop debugging.
- Add a new file called "Home.razor.js"
- Run the project again and change the color property in "Home.razor.css" once more.
- You should now see this dialog telling you it went wrong:

Exceptions (if any)
18:19 18.29 HotReloadDestroyer: Scoped CSS file changed: Z:\Dotnet\HotReloadDestroyer\Components\Pages\Home.razor.css
18:19 18.35 HotReloadDestroyer: Building scoped CSS files in project HotReloadDestroyer
18:19 18.59 HotReloadDestroyer: [Error] Building scoped CSS files failed for project HotReloadDestroyer
18:19 18.59 Invalid changes were found. Please refer to the Error List window to fix those issues.
18:19 27.95 HotReloadDestroyer (Web server): Hot reload session complete
.NET Version
9.0.100-preview.7.24407.12
Anything else?
I've encountered this problem in both .NET 8 and .NET 9.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status