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: Adding a code block at runtime does not get hot reloaded, even refreshing the browser doesn't show the change. #34465

Closed
MacdonaldRobinson opened this issue Jul 18, 2021 · 1 comment
Assignees
Labels
area-blazor Includes: Blazor, Razor Components feature-hot-reload This issue is related to the Hot Reload feaature investigate
Milestone

Comments

@MacdonaldRobinson
Copy link

MacdonaldRobinson commented Jul 18, 2021

Describe the bug

Hot Reload: Adding a code block at runtime does not get hot reloaded, even refreshing the browser doesn't show the change.

image

To Reproduce

  • In WSL - Ubuntu 20.04 LTS
  • Create a new web app using "dotnet new blazorwasm"
  • Use "code ." to open it in VS Code
  • In the Terminal type "dotnet watch"
  • Open the link in the browser
  • Open Pages/Index.razor
  • Add a new code block and create a new property like "color"
  • Now create a new line outside the code block to display this property value
  • Now save the file
  • You will notice in the console that the change IS detected however you get the message: "No hot reload changes to apply"
  • Force refresh the browser and you will still not see your change
  • CTRL + SHIFT + R does not work for some reason so you will need to stop and restart the app
  • You will now see your changes

Expectation

Code block changes are applied via hot reload

Output of dotnet --info

.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.6.21355.2
Commit: 7f8e0d76c0

Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /home/mac/dotnet/sdk/6.0.100-preview.6.21355.2/

Host (useful for support):
Version: 6.0.0-preview.6.21352.12
Commit: 770d630b28

.NET SDKs installed:
6.0.100-preview.6.21355.2 [/home/mac/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.6.21355.2 [/home/mac/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-preview.6.21352.12 [/home/mac/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-hot-reload This issue is related to the Hot Reload feaature labels Jul 19, 2021
@mkArtakMSFT mkArtakMSFT added this to the 6.0-rc2 milestone Jul 19, 2021
@pranavkm pranavkm self-assigned this Aug 26, 2021
@pranavkm
Copy link
Contributor

pranavkm commented Sep 9, 2021

Thanks for the issue report @MacdonaldRobinson. For 6.0, adding a field is a rude edit with the WebAssembly runtime and requires a full rebuild. We were previously handling this incorrectly and suppressing the error the runtime would throw which explained some of the weird behavior you were seeing here. With a more recent SDK, dotnet-watch produces a rude edit when you make this change.

We are using dotnet/runtime#57365 to support more kinds of edits in the Mono runtime for 7.0.

@pranavkm pranavkm closed this as completed Sep 9, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-hot-reload This issue is related to the Hot Reload feaature investigate
Projects
None yet
Development

No branches or pull requests

4 participants