Open Bug 1978455 Opened 1 month ago Updated 18 days ago

Blazor Server App does not run in Firefox

Categories

(Web Compatibility :: Site Reports, defect)

Firefox 140
defect

Tracking

(Webcompat Score:1)

UNCONFIRMED
Webcompat Score 1

People

(Reporter: rlewis-0w, Unassigned, NeedInfo)

Details

Attachments

(1 file)

326.05 KB, application/x-zip-compressed
Details

Steps to reproduce:

  1. In Microsoft Visual Studio Community, create a new project. Select Blazor Web App to get a Blazor Server app. Set project name and location as you wish. Select:
    Framework: NET 8.0 (Long Term Support)
    Authentication type: None
    Interactive render mode: Server
    Interactivity location: Global
    Include sample pages: unchecked
    Do not use top-level statements: checked
    Create the project (i.e. Solution).

  2. On the button at the top (but below the menus) that says "https", click the dropdown. Make sure HTTPS is selected and not HTTP. Make sure Firefox is the browser selected. Click 'https'.

Actual results:

A yellow bar appears across the bottom: "An unhandled error has occurred. Reload".
Pressing F12 and going to the Console for Firefox shows these messages:
[2025-07-21T20:24:16.888Z] Information: Normalizing '_blazor' to 'https://localhost:7101/_blazor'. blazor.web.js:1:47009
[2025-07-21T20:24:16.970Z] Information: WebSocket connected to wss://localhost:7101/_blazor?id=mUX-x2RPpVo0V_SN9O0GNA. blazor.web.js:1:47009
[2025-07-21T20:24:17.070Z] Error: There was an error applying batch 2. blazor.web.js:1:40375
[2025-07-21T20:24:17.079Z] Error: There was an error applying batch 3. blazor.web.js:1:40375
[2025-07-21T20:24:17.103Z] Error: There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'. blazor.web.js:1:40375
[2025-07-21T20:24:17.103Z] Information: Connection disconnected. blazor.web.js:1:47009

The PowerShell window has this content showing two fail points:
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:7101
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5293
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: D:\Users\rlewi\Documents\Reconciler for Manager\FirefoxWontRun\Server\FirefoxWontRunBlazorServer
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: TypeError: can't access property "insertBefore", n.parentNode is null
System.InvalidOperationException: TypeError: can't access property "insertBefore", n.parentNode is null
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'e4rZkiRfwznI6q5kA8jw-LbOOt4rkoCE1BCapoYNzDQ'.
System.AggregateException: One or more errors occurred. (TypeError: can't access property "insertBefore", n.parentNode is null)
---> System.InvalidOperationException: TypeError: can't access property "insertBefore", n.parentNode is null
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents)
--- End of inner exception stack trace ---
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: Error: No element is currently associated with component 1
System.InvalidOperationException: Error: No element is currently associated with component 1
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'e4rZkiRfwznI6q5kA8jw-LbOOt4rkoCE1BCapoYNzDQ'.
System.AggregateException: One or more errors occurred. (Error: No element is currently associated with component 1)
---> System.InvalidOperationException: Error: No element is currently associated with component 1
at Microsoft.AspNetCore.Components.RenderTree.Renderer.InvokeRenderCompletedCallsAfterUpdateDisplayTask(Task updateDisplayTask, Int32[] updatedComponents)
--- End of inner exception stack trace ---

Expected results:

It should just run. It should not get stuck from fatal runtime errors.

I am attaching the default Blazor Server app that does not run in Firefox.

This default Blazor Server app runs in Chrome and Edge. But we don't really know whether it is a Microsoft problem or a Firefox problem just from that. We would have to figure out what is wrong first. In any case, I think Firefox wants to work for Blazor Server websites. And Blazor Server wants to work for Firefox. But this sample project indicates that they are not currently compatible.

This problem has been reported to Microsoft here:
https://developercommunity.visualstudio.com/t/Blazor-Web-Server-default-template-does/10937579?ref=native&refTime=1753131001485&refUserId=b0d16a19-ce34-4b5e-8beb-bdced55e38fd

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Navigation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Navigation
Product: Firefox → Core

This may be an issue for webcompat to take a look at.

On Firefox 142.0a1 Fedora Linux 42, creating a new project from the Blazor web app template via dotnet new blazor -f net8.0 --use-program-main --empty and then running it with dotnet run -lp https, which should be equivalent to the reporter's above steps using Visual Studio, does not reproduce this issue.

Component: DOM: Navigation → Site Reports
Product: Core → Web Compatibility
Webcompat Score: --- → 1

The severity field is not set for this bug.
:denschub, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(dschubert)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: