I am attempting to create a Blazor plugin (related question) that can be embedded in any random domain (call it randomClientDomain.com).
Everything seems to load but blazor.webassembly.js throws "The URI 'https://SomeRandomDomain.com' is not contained by the base URI 'https://politachat.com/plugin'"
For this specific error the index.html on randomClientDomain.com includes:
<head>
<base href="/" />
</head>
<body>
<div id="PolitaChatPlugin" class="col-11"></div>
<script src="https://politachat.com/plugin/_framework/blazor.webassembly.js"></script>
// some code omitted for brevity
</body>
and my Program.cs in the Blazor app is:
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri("/") });
I've tried just about every combination for <base>
and HttpClient
(edit: including ensuring the trailing forward slash is present in BaseAddress, where needed). I think the error is correct, but non-applicable in my case. Is it possible to fix it, or at least have it ignored?