79623376

Date: 2025-05-15 13:03:31
Score: 0.5
Natty:
Report link

Issue was that I didn't have

using Microsoft.AspNetCore.Components.WebAssembly.Hosting;

var builder = WebAssemblyHostBuilder.CreateDefault(args);

// This line
builder.Services.AddScoped(http => new HttpClient
{
    BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
});

await builder.Build().RunAsync();

in my code and only registered an httpclient in the server. This messed something up in the @inject HttpClient Http that was not visible in the f12 console for some reason.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: zhrgci