diff --git a/src/Blazor.BroadcastChannel/BroadcastChannelService.cs b/src/Blazor.BroadcastChannel/BroadcastChannelService.cs index 08bab84..a2b2a6d 100644 --- a/src/Blazor.BroadcastChannel/BroadcastChannelService.cs +++ b/src/Blazor.BroadcastChannel/BroadcastChannelService.cs @@ -1,4 +1,5 @@ -using Microsoft.JSInterop; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; namespace Blazor.BroadcastChannel { @@ -7,8 +8,10 @@ internal class BroadcastChannelService : IBroadcastChannelService private readonly Lazy> _moduleTask; public BroadcastChannelService(IJSRuntime jsRuntime) - { - _moduleTask = new(() => jsRuntime.InvokeAsync("import", "/_content/Blazor.BroadcastChannel/Blazor.BroadcastChannel.js")); + { + string path = "./_content/Blazor.BroadcastChannel/Blazor.BroadcastChannel.js"; + + _moduleTask = new(() => jsRuntime.InvokeAsync("import", path)); } public async Task CreateOrJoinAsync(string channelName)