Skip to content
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 Reload breaks CSS isolation when using a Razor class library #57660

Open
1 task done
MarkusRodler opened this issue Sep 2, 2024 · 5 comments
Open
1 task done
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-dotnetwatch This issue is related to the dotnet-watch command-line tool (now external) feature-hot-reload This issue is related to the Hot Reload feaature
Milestone

Comments

@MarkusRodler
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I created a new Blazor-Wasm project from scratch with a linked RCL. If I now edit a component CSS within the Client folder Hot Reload will remove the styles from the linked RCL.
If I inspect the Client.styles.css file it will remove the @import line after every hot reload:
image

Expected Behavior

Hot Reload works...

Steps To Reproduce

HotReloadBugSmall.mp4

Exceptions (if any)

No response

.NET Version

8.0.8

Anything else?

Reproducible with Windows and Linux

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Sep 2, 2024
@MackinnonBuck
Copy link
Member

Thanks for reaching out. We think this issue is getting fixed in an upcoming VS release. If you still experience the problem in Visual Studio 17.12, please file a Visual Studio Feedback ticket.

@MackinnonBuck MackinnonBuck closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
@MackinnonBuck MackinnonBuck added the External This is an issue in a component not contained in this repository. It is open for tracking purposes. label Sep 3, 2024
@MarkusRodler
Copy link
Contributor Author

@MackinnonBuck Well if you look at the video above you can see that this is not an Visual Studio issue. I'm using Visual Studio Code and used the command line to run dotnet watch run. So please reopen that issue.

@MackinnonBuck MackinnonBuck reopened this Sep 3, 2024
@MackinnonBuck MackinnonBuck removed the External This is an issue in a component not contained in this repository. It is open for tracking purposes. label Sep 3, 2024
@MackinnonBuck MackinnonBuck self-assigned this Sep 3, 2024
@MackinnonBuck MackinnonBuck added this to the 9.0-rc2 milestone Sep 3, 2024
@MackinnonBuck
Copy link
Member

I was able to reproduce this on the .NET 8 SDK, but it seems to have been fixed in .NET 9. @tmat, does this happen to ring a bell?
It also seems that this issue doesn't repro in VS (even when using the .NET 8 SDK), which makes me think this problem is specific to dotnet watch.

@MackinnonBuck
Copy link
Member

Related: #45987

@tmat
Copy link
Member

tmat commented Sep 5, 2024

I don't know what cased/fixed this issue.

@mkArtakMSFT mkArtakMSFT modified the milestones: 9.0-rc2, 8.0.x Sep 9, 2024
@mkArtakMSFT mkArtakMSFT added feature-hot-reload This issue is related to the Hot Reload feaature feature-dotnetwatch This issue is related to the dotnet-watch command-line tool (now external) bug This issue describes a behavior which is not expected - a bug. labels Sep 9, 2024
@mkArtakMSFT mkArtakMSFT modified the milestones: 8.0.x, Backlog Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-dotnetwatch This issue is related to the dotnet-watch command-line tool (now external) feature-hot-reload This issue is related to the Hot Reload feaature
Projects
None yet
Development

No branches or pull requests

4 participants