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 reloading fails after the second change of a razor file #59027

Open
1 task done
akorchev opened this issue Nov 18, 2024 · 12 comments
Open
1 task done

Hot reloading fails after the second change of a razor file #59027

akorchev opened this issue Nov 18, 2024 · 12 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components feature-hot-reload This issue is related to the Hot Reload feaature

Comments

@akorchev
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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

  1. Create a new app by running dotnet new blazor -int Auto -o Blazor9Auto in some directory (from command prompt).
  2. Run the application dotnet watch --project Blazor9Auto/Blazor9Auto.csproj This should open the browser.
  3. Open Blazor9Auto/Components/Pages/Home.razor and change it somehow then save it. Make a few changes and save a few times.
    Image

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:

.NET SDK:
 Version:           9.0.100
 Commit:            59db016f11
 Workload version:  9.0.100-manifests.3068a692
 MSBuild version:   17.12.7+5b8665660

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.0
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/9.0.100/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.0
  Architecture: arm64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  6.0.406 [/usr/local/share/dotnet/sdk]
  7.0.403 [/usr/local/share/dotnet/sdk]
  8.0.403 [/usr/local/share/dotnet/sdk]
  9.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Nov 18, 2024
@akorchev akorchev changed the title Hot reloading fails after second change of a razor file Hot reloading fails after the second change of a razor file Nov 18, 2024
@danroth27 danroth27 added the feature-hot-reload This issue is related to the Hot Reload feaature label Nov 18, 2024
@danroth27
Copy link
Member

@tmat Is this a known issue? Also, in which repo should this be tracked?

@tmat
Copy link
Member

tmat commented Nov 18, 2024

@akorchev Could you please run dotnet watch --verbose and share output?

@akorchev
Copy link
Author

Here is the complete output until the error:

dotnet watch ⌚ Running MSBuild target 'GenerateWatchList' on '/Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Blazor9Auto.csproj'
dotnet watch 🚀 Launched '/usr/local/share/dotnet/dotnet' with arguments 'msbuild /nologo /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Blazor9Auto.csproj /p:_DotNetWatchListFile=/var/folders/dr/5n3y3yqx0cbf982xvkjjy1_m0000gn/T/tmpiuxdP9.tmp /nologo /v:n /t:GenerateWatchList /p:DotNetWatchBuild=true /p:DesignTimeBuild=true /p:CustomAfterMicrosoftCommonTargets=/usr/local/share/dotnet/sdk/9.0.100/DotnetTools/dotnet-watch/9.0.100-rtm.24529.9/tools/net9.0/any/DotNetWatch.targets /p:CustomAfterMicrosoftCommonCrossTargetingTargets=/usr/local/share/dotnet/sdk/9.0.100/DotnetTools/dotnet-watch/9.0.100-rtm.24529.9/tools/net9.0/any/DotNetWatch.targets /p:_DotNetWatchTraceOutput=true': process id 35118
dotnet watch ⌚ Process id 35118 ran for 512ms.
dotnet watch ⌚ Watching 64 file(s) for changes
dotnet watch ⌚ Target process is '/Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/bin/Debug/net9.0/Blazor9Auto'
dotnet watch ⌚ Configuring the app to use browser-refresh middleware
dotnet watch ⌚ dotnet-watch is configured to launch a browser on ASP.NET Core application startup.
dotnet watch ⌚ Refresh server running at wss://localhost:59109,ws://localhost:59110.
dotnet watch 🔥 HotReloadProfile: BlazorHosted. /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Blazor9Auto.csproj references BlazorWebAssembly project /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Blazor9Auto.Client.csproj.
dotnet watch ⌚ [Blazor9Auto (net9.0)] Waiting for application to connect to pipe 3d3375b3-7082-4b84-aef1-23c649fbbd81.
dotnet watch 🚀 [Blazor9Auto (net9.0)] Launched '/usr/local/share/dotnet/dotnet' with arguments '[env:DOTNET_MODIFIABLE_ASSEMBLIES=debug] [env:DOTNET_WATCH_HOTRELOAD_NAMEDPIPE_NAME=3d3375b3-7082-4b84-aef1-23c649fbbd81] [env:DOTNET_STARTUP_HOOKS=/usr/local/share/dotnet/sdk/9.0.100/DotnetTools/dotnet-watch/9.0.100-rtm.24529.9/tools/net9.0/any/hotreload/Microsoft.Extensions.DotNetDeltaApplier.dll:/usr/local/share/dotnet/sdk/9.0.100/DotnetTools/dotnet-watch/9.0.100-rtm.24529.9/tools/net9.0/any/middleware/Microsoft.AspNetCore.Watch.BrowserRefresh.dll] run --project Blazor9Auto/Blazor9Auto.csproj': process id 35123
dotnet watch ⌚ [Blazor9Auto (net9.0)] Connecting to the browser.
Using launch settings from Blazor9Auto/Properties/launchSettings.json...
Building...
dotnet watch 🕵️ [3d3375b3-7082-4b84-aef1-23c649fbbd81] Loaded into process: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/bin/Debug/net9.0/Blazor9Auto.dll
dotnet watch 🕵️ [3d3375b3-7082-4b84-aef1-23c649fbbd81] Connecting to hot-reload server
dotnet watch 🕵️ [3d3375b3-7082-4b84-aef1-23c649fbbd81] Connected.
dotnet watch ⌚ [Blazor9Auto (net9.0)] Capabilities: 'Baseline AddMethodToExistingType AddStaticFieldToExistingType AddInstanceFieldToExistingType NewTypeDefinition ChangeCustomAttributes UpdateParameters GenericUpdateMethod GenericAddMethodToExistingType GenericAddFieldToExistingType'
dotnet watch ⌚ [Blazor9Auto (net9.0)] Build completed.
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5185
dotnet watch ⌚ Launching browser: http://localhost:5185/ 
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto
dotnet watch ⌚ Solution: 
dotnet watch ⌚   Project: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Blazor9Auto.csproj
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Program.cs [M3daYNCl15GjwpVL6QMKT4I99AshNzNJrAcHbhNxxWg=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.GlobalUsings.g.cs [zNOfYtkaH2fDUlF4wBMd//cYs1xeWL6xT2qAgn8h6tE=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [wFVmrIF4bp48hfUHcvah88bUgmeJ01+gr+jhzn8heaw=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.AssemblyInfo.cs [hAD9XBrQYzPc2R4LQn8uuAZvNuiDfysq25JpzwBdhjo=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/App.razor [e3Ct3YJ+shgpRn4Nxl4R0xnbV3gTAOXA6vZh36//gbs=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Error.razor [53RzeA5T8rptQhBbdF0+ynzb2uwdQHvEaozpM4tD6yk=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Home.razor [aitMJl1qlbEya1eowUF8oWI1AXwbW6w0eCYXUooTl+U=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Weather.razor [Wyqu55gKfQTo0cV/QVztCDN5GAOOHgNZAtENTwOAuPw=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Routes.razor [VQEQrnsdTuAUDbhhlH9Wa+IjCiFisqKbw3JdNyR2JUY=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/_Imports.razor [6QR++ufNocHORJWVRoIrhvEhVNsBs4tLTTg32EOmqKE=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Layout/MainLayout.razor [lhL4sAhoNNks19jkdl/r0UuvifW3qo8mYfzRs4ApZDk=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Layout/NavMenu.razor [AANqNG0p92wjWgT4SdAAt54n6EhQidLcJCe724pGuQ8=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/config/analysislevelstyle_default.globalconfig [hEpukUoMLsBtXxp71k2fv7gWVIYblPaVHMCq/Acy5Cw=]
dotnet watch ⌚     Config: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.GeneratedMSBuildEditorConfig.editorconfig [hL79CUMiNGPG/OUJ/6R7i+C9XAMO6KFVNi2FmHSG1wA=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_9_default.globalconfig [ZRFi6tgci8t+nmaiOxtng/+Dca1YjDn+JWY1//eQ7FQ=]
dotnet watch ⌚   Project: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Blazor9Auto.Client.csproj
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Program.cs [r/SU/vdNOyvHeH/0lOT6uqeALn2GaIstT6vcdRYXgx0=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.GlobalUsings.g.cs [XtQXDhitbZZWhrDAgJxajm7wh9mVS+nqg5M5hRSyvvc=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [wFVmrIF4bp48hfUHcvah88bUgmeJ01+gr+jhzn8heaw=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.AssemblyInfo.cs [9sJBkTEQtxU59fkgzGJyEZjSis27WHgd75baDv1ccD8=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Pages/Counter.razor [1JzS3bojnU5wnhzhdIzrOvD9g9UEJBZak+pvhLVLc/k=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/_Imports.razor [nUoZCaXubBvBtP9iLRL+CHKwiT1WLgYr/ayzODk7IaQ=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/config/analysislevelstyle_default.globalconfig [hEpukUoMLsBtXxp71k2fv7gWVIYblPaVHMCq/Acy5Cw=]
dotnet watch ⌚     Config: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.GeneratedMSBuildEditorConfig.editorconfig [2myCT9vbVySwdJuByY82h/+mffvxRpzVNUDC7n60/Xk=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_9_default.globalconfig [ZRFi6tgci8t+nmaiOxtng/+Dca1YjDn+JWY1//eQ7FQ=]
dotnet watch 🔥 Hot reload session started.
dotnet watch ⌚ Waiting for changes
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
      Failed to determine the https port for redirect.
dotnet watch ⌚ [Blazor9Auto (net9.0)] Exception while reading WASM runtime capabilities: window.Blazor._internal.getApplyUpdateCapabilities is not a function. (In 'window.Blazor._internal.getApplyUpdateCapabilities()', 'window.Blazor._internal.getApplyUpdateCapabilities' is undefined)
getBlazorWasmApplyUpdateCapabilities@http://localhost:5185/_framework/aspnetcore-browser-refresh.js:101:83
BlazorRequestApplyUpdateCapabilities2@http://localhost:5185/_framework/aspnetcore-browser-refresh.js:51:92
@http://localhost:5185/_framework/aspnetcore-browser-refresh.js:56:29
dotnet watch ⌚ [Blazor9Auto (net9.0)] Falling back to default WASM capabilities: 'Baseline AddMethodToExistingType AddStaticFieldToExistingType NewTypeDefinition ChangeCustomAttributes AddInstanceFieldToExistingType GenericAddMethodToExistingType GenericUpdateMethod UpdateParameters GenericAddFieldToExistingType'
dotnet watch ⌚ File change: Update '/Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Home.razor' (written 18:35:50.6737244 after 18:35:26.3373280).
dotnet watch ⌚ File updated: ./Blazor9Auto/Components/Pages/Home.razor
dotnet watch ⌚ Solution: 
dotnet watch ⌚   Project: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Blazor9Auto.csproj
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Program.cs [M3daYNCl15GjwpVL6QMKT4I99AshNzNJrAcHbhNxxWg=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.GlobalUsings.g.cs [zNOfYtkaH2fDUlF4wBMd//cYs1xeWL6xT2qAgn8h6tE=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [wFVmrIF4bp48hfUHcvah88bUgmeJ01+gr+jhzn8heaw=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.AssemblyInfo.cs [hAD9XBrQYzPc2R4LQn8uuAZvNuiDfysq25JpzwBdhjo=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/App.razor [e3Ct3YJ+shgpRn4Nxl4R0xnbV3gTAOXA6vZh36//gbs=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Error.razor [53RzeA5T8rptQhBbdF0+ynzb2uwdQHvEaozpM4tD6yk=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Home.razor [h0cki/pdDGdrZRk1gX3Ut79aFAk=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Weather.razor [Wyqu55gKfQTo0cV/QVztCDN5GAOOHgNZAtENTwOAuPw=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Routes.razor [VQEQrnsdTuAUDbhhlH9Wa+IjCiFisqKbw3JdNyR2JUY=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/_Imports.razor [6QR++ufNocHORJWVRoIrhvEhVNsBs4tLTTg32EOmqKE=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Layout/MainLayout.razor [lhL4sAhoNNks19jkdl/r0UuvifW3qo8mYfzRs4ApZDk=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Layout/NavMenu.razor [AANqNG0p92wjWgT4SdAAt54n6EhQidLcJCe724pGuQ8=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/config/analysislevelstyle_default.globalconfig [hEpukUoMLsBtXxp71k2fv7gWVIYblPaVHMCq/Acy5Cw=]
dotnet watch ⌚     Config: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.GeneratedMSBuildEditorConfig.editorconfig [hL79CUMiNGPG/OUJ/6R7i+C9XAMO6KFVNi2FmHSG1wA=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_9_default.globalconfig [ZRFi6tgci8t+nmaiOxtng/+Dca1YjDn+JWY1//eQ7FQ=]
dotnet watch ⌚   Project: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Blazor9Auto.Client.csproj
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Program.cs [r/SU/vdNOyvHeH/0lOT6uqeALn2GaIstT6vcdRYXgx0=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.GlobalUsings.g.cs [XtQXDhitbZZWhrDAgJxajm7wh9mVS+nqg5M5hRSyvvc=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [wFVmrIF4bp48hfUHcvah88bUgmeJ01+gr+jhzn8heaw=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.AssemblyInfo.cs [9sJBkTEQtxU59fkgzGJyEZjSis27WHgd75baDv1ccD8=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Pages/Counter.razor [1JzS3bojnU5wnhzhdIzrOvD9g9UEJBZak+pvhLVLc/k=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/_Imports.razor [nUoZCaXubBvBtP9iLRL+CHKwiT1WLgYr/ayzODk7IaQ=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/config/analysislevelstyle_default.globalconfig [hEpukUoMLsBtXxp71k2fv7gWVIYblPaVHMCq/Acy5Cw=]
dotnet watch ⌚     Config: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.GeneratedMSBuildEditorConfig.editorconfig [2myCT9vbVySwdJuByY82h/+mffvxRpzVNUDC7n60/Xk=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_9_default.globalconfig [ZRFi6tgci8t+nmaiOxtng/+Dca1YjDn+JWY1//eQ7FQ=]
dotnet watch ⌚ No hot reload changes to apply.
dotnet watch ⌚ Updating diagnostics in the browser.
dotnet watch 🔥 Hot reload change handled in 36ms.
dotnet watch ⌚ File change: Update '/Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Home.razor' (written 18:35:53.9389531 after 18:35:26.3373280).
dotnet watch ⌚ File updated: ./Blazor9Auto/Components/Pages/Home.razor
dotnet watch ⌚ Solution: 
dotnet watch ⌚   Project: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Blazor9Auto.csproj
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Program.cs [M3daYNCl15GjwpVL6QMKT4I99AshNzNJrAcHbhNxxWg=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.GlobalUsings.g.cs [zNOfYtkaH2fDUlF4wBMd//cYs1xeWL6xT2qAgn8h6tE=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [wFVmrIF4bp48hfUHcvah88bUgmeJ01+gr+jhzn8heaw=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.AssemblyInfo.cs [hAD9XBrQYzPc2R4LQn8uuAZvNuiDfysq25JpzwBdhjo=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/App.razor [e3Ct3YJ+shgpRn4Nxl4R0xnbV3gTAOXA6vZh36//gbs=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Error.razor [53RzeA5T8rptQhBbdF0+ynzb2uwdQHvEaozpM4tD6yk=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Home.razor [Oc93W/bjOOb+cokaTT1uMKE/Uww=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Weather.razor [Wyqu55gKfQTo0cV/QVztCDN5GAOOHgNZAtENTwOAuPw=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Routes.razor [VQEQrnsdTuAUDbhhlH9Wa+IjCiFisqKbw3JdNyR2JUY=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/_Imports.razor [6QR++ufNocHORJWVRoIrhvEhVNsBs4tLTTg32EOmqKE=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Layout/MainLayout.razor [lhL4sAhoNNks19jkdl/r0UuvifW3qo8mYfzRs4ApZDk=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Layout/NavMenu.razor [AANqNG0p92wjWgT4SdAAt54n6EhQidLcJCe724pGuQ8=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/config/analysislevelstyle_default.globalconfig [hEpukUoMLsBtXxp71k2fv7gWVIYblPaVHMCq/Acy5Cw=]
dotnet watch ⌚     Config: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.GeneratedMSBuildEditorConfig.editorconfig [hL79CUMiNGPG/OUJ/6R7i+C9XAMO6KFVNi2FmHSG1wA=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_9_default.globalconfig [ZRFi6tgci8t+nmaiOxtng/+Dca1YjDn+JWY1//eQ7FQ=]
dotnet watch ⌚   Project: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Blazor9Auto.Client.csproj
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Program.cs [r/SU/vdNOyvHeH/0lOT6uqeALn2GaIstT6vcdRYXgx0=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.GlobalUsings.g.cs [XtQXDhitbZZWhrDAgJxajm7wh9mVS+nqg5M5hRSyvvc=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [wFVmrIF4bp48hfUHcvah88bUgmeJ01+gr+jhzn8heaw=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.AssemblyInfo.cs [9sJBkTEQtxU59fkgzGJyEZjSis27WHgd75baDv1ccD8=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Pages/Counter.razor [1JzS3bojnU5wnhzhdIzrOvD9g9UEJBZak+pvhLVLc/k=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/_Imports.razor [nUoZCaXubBvBtP9iLRL+CHKwiT1WLgYr/ayzODk7IaQ=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/config/analysislevelstyle_default.globalconfig [hEpukUoMLsBtXxp71k2fv7gWVIYblPaVHMCq/Acy5Cw=]
dotnet watch ⌚     Config: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.GeneratedMSBuildEditorConfig.editorconfig [2myCT9vbVySwdJuByY82h/+mffvxRpzVNUDC7n60/Xk=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_9_default.globalconfig [ZRFi6tgci8t+nmaiOxtng/+Dca1YjDn+JWY1//eQ7FQ=]
dotnet watch 🔥 Hot reload capabilities: Baseline AddMethodToExistingType AddStaticFieldToExistingType NewTypeDefinition ChangeCustomAttributes AddInstanceFieldToExistingType GenericAddMethodToExistingType GenericUpdateMethod UpdateParameters GenericAddFieldToExistingType.
dotnet watch ⌚ Updating diagnostics in the browser.
dotnet watch 🕵️ [3d3375b3-7082-4b84-aef1-23c649fbbd81] ResponseLoggingLevel = Verbose
dotnet watch 🕵️ [Blazor9Auto (net9.0)] Writing capabilities: Baseline AddMethodToExistingType AddStaticFieldToExistingType AddInstanceFieldToExistingType NewTypeDefinition ChangeCustomAttributes UpdateParameters GenericUpdateMethod GenericAddMethodToExistingType GenericAddFieldToExistingType
dotnet watch 🕵️ [Blazor9Auto (net9.0)] Attempting to apply deltas.
dotnet watch 🕵️ [Blazor9Auto (net9.0)] Invoking metadata update handlers.
dotnet watch 🕵️ [Blazor9Auto (net9.0)] Deltas applied.
dotnet watch 🔥 [Blazor9Auto (net9.0)] Updates applied: 1 out of 1.
dotnet watch 🔥 [Blazor9Auto (net9.0)] Hot reload succeeded.
dotnet watch ⌚ [Blazor9Auto (net9.0)] Refreshing browser.
dotnet watch 🔥 Hot reload change handled in 2924ms.
dotnet watch ⌚ File change: Update '/Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Home.razor' (written 18:36:02.6424167 after 18:35:26.3373280).
dotnet watch ⌚ File updated: ./Blazor9Auto/Components/Pages/Home.razor
dotnet watch ⌚ Solution: 
dotnet watch ⌚   Project: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Blazor9Auto.csproj
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Program.cs [M3daYNCl15GjwpVL6QMKT4I99AshNzNJrAcHbhNxxWg=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.GlobalUsings.g.cs [zNOfYtkaH2fDUlF4wBMd//cYs1xeWL6xT2qAgn8h6tE=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [wFVmrIF4bp48hfUHcvah88bUgmeJ01+gr+jhzn8heaw=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.AssemblyInfo.cs [hAD9XBrQYzPc2R4LQn8uuAZvNuiDfysq25JpzwBdhjo=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/App.razor [e3Ct3YJ+shgpRn4Nxl4R0xnbV3gTAOXA6vZh36//gbs=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Error.razor [53RzeA5T8rptQhBbdF0+ynzb2uwdQHvEaozpM4tD6yk=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Home.razor [ROLwBT7Wq4orNnHNOJWK1GCRgkM=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Pages/Weather.razor [Wyqu55gKfQTo0cV/QVztCDN5GAOOHgNZAtENTwOAuPw=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Routes.razor [VQEQrnsdTuAUDbhhlH9Wa+IjCiFisqKbw3JdNyR2JUY=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/_Imports.razor [6QR++ufNocHORJWVRoIrhvEhVNsBs4tLTTg32EOmqKE=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Layout/MainLayout.razor [lhL4sAhoNNks19jkdl/r0UuvifW3qo8mYfzRs4ApZDk=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/Components/Layout/NavMenu.razor [AANqNG0p92wjWgT4SdAAt54n6EhQidLcJCe724pGuQ8=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/config/analysislevelstyle_default.globalconfig [hEpukUoMLsBtXxp71k2fv7gWVIYblPaVHMCq/Acy5Cw=]
dotnet watch ⌚     Config: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto/obj/Debug/net9.0/Blazor9Auto.GeneratedMSBuildEditorConfig.editorconfig [hL79CUMiNGPG/OUJ/6R7i+C9XAMO6KFVNi2FmHSG1wA=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_9_default.globalconfig [ZRFi6tgci8t+nmaiOxtng/+Dca1YjDn+JWY1//eQ7FQ=]
dotnet watch ⌚   Project: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Blazor9Auto.Client.csproj
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Program.cs [r/SU/vdNOyvHeH/0lOT6uqeALn2GaIstT6vcdRYXgx0=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.GlobalUsings.g.cs [XtQXDhitbZZWhrDAgJxajm7wh9mVS+nqg5M5hRSyvvc=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.cs [wFVmrIF4bp48hfUHcvah88bUgmeJ01+gr+jhzn8heaw=]
dotnet watch ⌚     Document: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.AssemblyInfo.cs [9sJBkTEQtxU59fkgzGJyEZjSis27WHgd75baDv1ccD8=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/Pages/Counter.razor [1JzS3bojnU5wnhzhdIzrOvD9g9UEJBZak+pvhLVLc/k=]
dotnet watch ⌚     Additional: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/_Imports.razor [nUoZCaXubBvBtP9iLRL+CHKwiT1WLgYr/ayzODk7IaQ=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/config/analysislevelstyle_default.globalconfig [hEpukUoMLsBtXxp71k2fv7gWVIYblPaVHMCq/Acy5Cw=]
dotnet watch ⌚     Config: /Users/korchev/github/net9/Blazor9Auto/Blazor9Auto.Client/obj/Debug/net9.0/Blazor9Auto.Client.GeneratedMSBuildEditorConfig.editorconfig [2myCT9vbVySwdJuByY82h/+mffvxRpzVNUDC7n60/Xk=]
dotnet watch ⌚     Config: /usr/local/share/dotnet/sdk/9.0.100/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_9_default.globalconfig [ZRFi6tgci8t+nmaiOxtng/+Dca1YjDn+JWY1//eQ7FQ=]
dotnet watch ⌚ Updating diagnostics in the browser.
dotnet watch 🕵️ [3d3375b3-7082-4b84-aef1-23c649fbbd81] ResponseLoggingLevel = Verbose
dotnet watch ❌ [Blazor9Auto (net9.0)] Change failed to apply (error code: '00-03-00-00-00-1B-41-74-74-65-6D-70-74-69-6E-67'). Further changes won't be applied to this process.
dotnet watch ⌚ [Blazor9Auto (net9.0)] Disposing pipe
dotnet watch 🔥 [Blazor9Auto (net9.0)] Updates applied: 1 out of 1.
dotnet watch 🕵️ [3d3375b3-7082-4b84-aef1-23c649fbbd81] Unable to read beyond the end of the stream.
dotnet watch 🕵️ [3d3375b3-7082-4b84-aef1-23c649fbbd81] Stopped received delta updates. Server is no longer connected.

@willdean
Copy link

@danroth27 wrote

Is this a known issue? Also, in which repo should this be tracked?

There are a number of similar issues open in the SDK repo.

@danroth27
Copy link
Member

There are a number of similar issues open in the SDK repo.

@willdean Can you share the issue links?

@willdean
Copy link

willdean commented Nov 18, 2024

Here's mine which doesn't sound exactly like the above, but people have added comments that do:
dotnet/sdk#44912

Here's another which is more like mine: dotnet/sdk#44910

Here;'s one which references Blazor: dotnet/sdk#44384

@tmat
Copy link
Member

tmat commented Nov 19, 2024

Looks like this is a general problem when the WASM runtime is not loaded yet when dotnet-watch tries to connect to the browser:

 [Blazor9Auto (net9.0)] Exception while reading WASM runtime capabilities: window.Blazor._internal.getApplyUpdateCapabilities is not a function. (In 'window.Blazor._internal.getApplyUpdateCapabilities()', 'window.Blazor._internal.getApplyUpdateCapabilities' is undefined)

Doesn't seem like a regression. I don't think this ever worked reliably. Will need to figure out what to do about it.

@afallingstone
Copy link

I am also having this issue and I find it interesting that your terminal shows "building..." on app start, mine doesn't.

@akorchev
Copy link
Author

Here are a few more tests that I conducted.

.NET 8 Blazor app with Auto interactivity

I tested an existing .NET 8 app created long before installing .NET 9 (dotnet new blazor -int Auto -o Blazor8Auto). Running the app now (with .NET 9) has the same issue. The second save of Home.razor outputs ❌ [Blazor8Auto (net8.0)] Change failed to apply (error code: '00-00-00-00-00'). Further changes won't be applied to this process..

Adding a global.json with the following content solves the problem completely:

{
  "sdk": {
    "version": "8.0.403"
  }
}

I can update Home.razor many times and the error does not appear.

.NET 9 Blazor app with Server interactivity

I then created a server interactivity app to eliminate issues related to WASM runtime loading. To do that I used dotnet new blazor -int Server -o Blazor9Server. I observed the exact same thing after saving Home.razor a second time:

➜  Blazor9Server dotnet watch
dotnet watch 🔥 Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
  💡 Press "Ctrl + R" to restart.
Using launch settings from /Users/korchev/github/net9/Blazor9Server/Properties/launchSettings.json...
Building...
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5243
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /Users/korchev/github/net9/Blazor9Server
warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3]
      Failed to determine the https port for redirect.
dotnet watch ⌚ File updated: ./Components/Pages/Home.razor
dotnet watch 🔥 [Blazor9Server (net9.0)] Hot reload succeeded.
dotnet watch ⌚ File updated: ./Components/Pages/Home.razor
dotnet watch ❌ [Blazor9Server (net9.0)] Change failed to apply (error code: '00-00-00-00-00'). Further changes won't be applied to this process.

.NET 9 Blazor app without interactivity

Then I created a Blazor app without interactivity via dotnet new blazor -o Blazor9. The same error was output after the second time I updated Home.razor.

Those tests made me think that:

  1. This appears to be a regression since a .NET 8 app works just fine with a globa.json without any additional modifications (on the exact same system).
  2. The problems does not seem to be related to WASM runtime loading as apps that don't load it fail in the exact same way.

For completeness purposes I tested on a different Mac with the same results. Also tried with different browsers - the results were the same.

@v-Lily
Copy link

v-Lily commented Nov 22, 2024

@tmat This issue also reproduces in the latest 10.0 Preview 1 SDK on Linux/Mac OS.
Image

We have a known issue [#3202] that has been fixed in the old 10.0 Preview 1 SDK version [detail info].

@asaf92
Copy link

asaf92 commented Nov 22, 2024

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

@MelvinSnijders
Copy link

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

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 feature-hot-reload This issue is related to the Hot Reload feaature
Projects
None yet
Development

No branches or pull requests

8 participants