HotReload fail 'ApplyHotReloadDelta' is supplied with exactly '4' parameters #45785
Labels
Area-AspNetCore
RazorSDK, BlazorWebAssemblySDK, dotnet-watch
untriaged
Request triage from a team member
Describe the bug
The Hot Reload feature in .NET 9 not works in Blazor WebAssembly project with browser error: Ensure that the call to `ApplyHotReloadDelta' is supplied with exactly '4' parameters.
To Reproduce
Can't reproduce on startup project, it happens on a project in production on every change on a blazor page.
Exceptions (if any)
In browser:
VM1977 aspnetcore-browser-refresh.js:152 ManagedError: Unexpected JSON token StartArray. Ensure that the call to `ApplyHotReloadDelta' is supplied with exactly '4' parameters.
at sn (marshal-to-js.ts:420:18)
at gn (managed-exports.ts:316:15)
at Object. (invoke-cs.ts:321:17)
at Object.invokeDotNetFromJS (blazor.webassembly.js:1:43918)
at v.invokeDotNetMethod (blazor.webassembly.js:1:3507)
at v.invokeDotNetStaticMethod (blazor.webassembly.js:1:3263)
at Qe._internal.applyHotReload (blazor.webassembly.js:1:52914)
at VM1977 aspnetcore-browser-refresh.js:150:35
at Array.forEach ()
at applyBlazorDeltas (VM1977 aspnetcore-browser-refresh.js:148:14)
overrideMethod @ hook.js:608
(anonymous) @ VM1977 aspnetcore-browser-refresh.js:152
applyBlazorDeltas @ VM1977 aspnetcore-browser-refresh.js:148
BlazorHotReloadDeltav2 @ VM1977 aspnetcore-browser-refresh.js:48
connection.onmessage @ VM1977 aspnetcore-browser-refresh.js:56
Further technical details
dotnet --info
dotnet --info
.NET SDK:
Version: 9.0.101
Commit: eedb237
Workload version: 9.0.100-manifests.1e472b70
MSBuild version: 17.12.12+1cce77968
Runtime Environment:
OS Name: Mac OS X
OS Version: 15.2
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/9.0.101/
.NET workloads installed:
[maui-tizen]
Installation Source: SDK 9.0.100
Manifest Version: 9.0.0/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maui/9.0.0/WorkloadManifest.json
Install Type: FileBased
[maui-ios]
Installation Source: SDK 9.0.100
Manifest Version: 9.0.0/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maui/9.0.0/WorkloadManifest.json
Install Type: FileBased
[maui-android]
Installation Source: SDK 9.0.100
Manifest Version: 9.0.0/9.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/9.0.100/microsoft.net.sdk.maui/9.0.0/WorkloadManifest.json
Install Type: FileBased
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.0
Architecture: arm64
Commit: 9d5a6a9aa4
.NET SDKs installed:
7.0.312 [/usr/local/share/dotnet/sdk]
7.0.313 [/usr/local/share/dotnet/sdk]
7.0.316 [/usr/local/share/dotnet/sdk]
7.0.317 [/usr/local/share/dotnet/sdk]
8.0.100 [/usr/local/share/dotnet/sdk]
8.0.101 [/usr/local/share/dotnet/sdk]
8.0.401 [/usr/local/share/dotnet/sdk]
9.0.101 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.22 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.16 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.19 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.8 [/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.22 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.19 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.8 [/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:
x64 [/usr/local/share/dotnet/x64]
registered at [/etc/dotnet/install_location_x64]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
dotnet watch 🔥 Hot reload capabilities: Baseline AddMethodToExistingType AddStaticFieldToExistingType NewTypeDefinition ChangeCustomAttributes AddInstanceFieldToExistingType GenericAddMethodToExistingType GenericUpdateMethod UpdateParameters GenericAddFieldToExistingType.
dotnet watch ⌚ Updating diagnostics in the browser.
dotnet watch ⌚ [horologiumrectus.web (net9.0)] Browser failed to apply the change and reported error:
dotnet watch ⌚ [horologiumrectus.web (net9.0)] Unexpected JSON token StartArray. Ensure that the call to
ApplyHotReloadDelta' is supplied with exactly '4' parameters. at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.ParseArguments(JSRuntime jsRuntime, String methodIdentifier, String arguments, Type[] parameterTypes) at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.InvokeSynchronously(JSRuntime jsRuntime, DotNetInvocationInfo& callInfo, IDotNetObjectReference objectReference, String argsJson) at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.Invoke(JSRuntime jsRuntime, DotNetInvocationInfo& invocationInfo, String argsJson) at Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime.InvokeDotNet(String assemblyName, String methodIdentifier, Int64 dotNetObjectId, String argsJson) at Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime.__Wrapper_InvokeDotNet_782839101(JSMarshalerArgument* __arguments_buffer) Error: Unexpected JSON token StartArray. Ensure that the call to
ApplyHotReloadDelta' is supplied with exactly '4' parameters.at sn (https://localhost:7251/_framework/dotnet.runtime.o8gq1i8bk6.js:3:26894)
at gn (https://localhost:7251/_framework/dotnet.runtime.o8gq1i8bk6.js:3:28882)
at Object. (https://localhost:7251/_framework/dotnet.runtime.o8gq1i8bk6.js:3:38412)
at Object.invokeDotNetFromJS (https://localhost:7251/_framework/blazor.webassembly.js:1:43918)
at v.invokeDotNetMethod (https://localhost:7251/_framework/blazor.webassembly.js:1:3507)
at v.invokeDotNetStaticMethod (https://localhost:7251/_framework/blazor.webassembly.js:1:3263)
at Qe._internal.applyHotReload (https://localhost:7251/_framework/blazor.webassembly.js:1:52914)
at https://localhost:7251/_framework/aspnetcore-browser-refresh.js:150:35
at Array.forEach ()
at applyBlazorDeltas (https://localhost:7251/_framework/aspnetcore-browser-refresh.js:148:14)
dotnet watch 🔥 Hot reload change handled in 3218ms.
The text was updated successfully, but these errors were encountered: