aspnetcore: blazor server signalr JsonReaderException

.net core 6 preview 6 Blazor server with Azure AD all this works fine after adding SignalR to the project I get an error when I start SignalR

hubConnectionBruger = new HubConnectionBuilder() .WithUrl(navManager.ToAbsoluteUri(“/hubs/useractivity”)) .WithAutomaticReconnect() .Build();

        hubConnectionBruger.On<int>("showUsersOnLine", (antal) =>
        {
            AntalBrugere = antal;
            StateHasChanged();
        });

        await hubConnectionBruger.StartAsync();

error: JsonReaderException: ‘<’ is an invalid start of a value

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Exceptions (if any)

Further technical details

  • ASP.NET Core version
  • Include the output of dotnet --info
  • The IDE (VS / VS Code/ VS4Mac) you’re running on, and its version

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Is your hub configured to be at the “/hubs/useractivity” endpoint? I’m guessing the ‘<’ is the start of an html page which likely means you’re not hitting a hub endpoint.