Skip to content

[8.0.100-preview.5.23276.4] DotNet.jsCallDispatcher.disposeJSObjectReferenceById is missing from blazor.server.js #48513

Closed
@Junjun-zhao

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When run the 3rd party apps against the latest .NET 8 Preview 5 build, pages fail to load with Microsoft.JSInterop.JSException that Could not find 'DotNet.jsCallDispatcher.disposeJSObjectReferenceById'

Application Name: BlazorBlogs, Blazorise
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-8.0.100-preview.5.23276.4

App source checking at Github Link: https://github.com/ADefWebserver/Blazor-Blogs
or https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1827614

Verify Scenarios:

  1. Windows10 21h2 x64 + dotnet-sdk-8.0.100-preview.5.23273.2: Pass
  2. Windows10 21h2 x64 + dotnet-sdk-8.0.100-preview.5.23276.4: Fail
  3. Windows10 21h2 x64 + dotnet-sdk-7.0.300: Pass

Expected Behavior

Counter page loads successfully.

Steps To Reproduce

Minimal Repro steps (demo attachedBlazorApp1.zip ):

The machine only has 8.0.100-preview.5.23276.4 installed and set DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX environment variable as 2.

1.Create a default Blazor Server application.
2. Install Toolbelt.Blazor.HeadElement nuget package to project.
3. Register service with this code in Program.cs:

builder.Services.AddHeadElementHelper();
  1. Add following code in Counter.razor:
@using Toolbelt.Blazor.HeadElement
<Title>Counter(@currentCount) - Server Side App</Title>
  1. Build the project.
  2. Update the runtime.config file to let the app run on 8.0.100-preview.5.23276.4.
  3. Launch the app.
  4. Click on the Counter menu on left side.

Exceptions (if any)

Counter page loads failed with following error in browser's Console tab or in Visual Studio output window:


fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit 'qdko5bp_9ueaj5mB_AhJtBVGJJX6zSN1Y3lJKSvgZHA'.
      Microsoft.JSInterop.JSException: Could not find 'DotNet.jsCallDispatcher.disposeJSObjectReferenceById' ('jsCallDispatcher' was undefined).
Error: Could not find 'DotNet.jsCallDispatcher.disposeJSObjectReferenceById' ('jsCallDispatcher' was undefined).
    at http://localhost:5142/_framework/blazor.server.js:1:537
    at Array.forEach (<anonymous>)
    at l.findFunction (http://localhost:5142/_framework/blazor.server.js:1:505)
    at b (http://localhost:5142/_framework/blazor.server.js:1:5271)
    at http://localhost:5142/_framework/blazor.server.js:1:3064
    at new Promise (<anonymous>)
    at v.beginInvokeJSFromDotNet (http://localhost:5142/_framework/blazor.server.js:1:3027)
    at Wt._invokeClientMethod (http://localhost:5142/_framework/blazor.server.js:1:76669)
    at Wt._processIncomingData (http://localhost:5142/_framework/blazor.server.js:1:74293)
    at Wt.connection.onreceive (http://localhost:5142/_framework/blazor.server.js:1:68652)
         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
         at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
         at Microsoft.JSInterop.Implementation.JSObjectReference.DisposeAsync()
         at Toolbelt.Blazor.HeadElement.HeadElementHelperService.EnsureScriptEnabledAsync[T]()
         at Toolbelt.Blazor.HeadElement.HeadElementHelperService.InvokeJSAsync[T](String identifier, Object[] args)
         at Toolbelt.Blazor.HeadElement.HeadElementHelperService.GetDefaultTitleAsync()
         at Toolbelt.Blazor.HeadElement.HeadElementHelperService.GetDefaultsAsync()
         at Toolbelt.Blazor.HeadElement.HeadElementHelperService.ResetIfNeededAsync()
         at Toolbelt.Blazor.HeadElement.HeadElementHelperService.SetTitleAsync(String title)
         at Toolbelt.Blazor.HeadElement.Title.OnParametersSetAsync()
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

.NET Version

8.0.100-preview.5.23276.4

Anything else?

Findings:

After comparing the blazor.server.js file between .NET 7 and .NET 8 Preview.5.23276.4, following code are missing in .NET 8 Preview.5.23276.4:
image

@dotnet-actwx-bot @dotnet/compat

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions