From b91dd20b9c7deb8e3888bd18880b7decef508a27 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 25 Aug 2021 14:07:05 -0700 Subject: [PATCH] Always download blazor-hotreload.js from app root The middleware that we inject always listens to the root of the app. While this might not play very nicely if the app is running off a virtual path, listening to the root is what we do with the aspnet-browser-refresh.js script and we've had no issue reports with it thus far. Fixes https://github.com/dotnet/aspnetcore/issues/35555 --- .../WebAssembly/src/HotReload/WebAssemblyHotReload.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs b/src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs index 271ea4cf638c..3d86b0dbfa1c 100644 --- a/src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs +++ b/src/Components/WebAssembly/WebAssembly/src/HotReload/WebAssemblyHotReload.cs @@ -29,7 +29,7 @@ internal static async Task InitializeAsync() // Attempt to read previously applied hot reload deltas. dotnet-watch and VS will serve the script that can provide results from local-storage and // the injected middleware if present. - var jsObjectReference = (IJSUnmarshalledObjectReference)(await DefaultWebAssemblyJSRuntime.Instance.InvokeAsync("import", "./_framework/blazor-hotreload.js")); + var jsObjectReference = (IJSUnmarshalledObjectReference)(await DefaultWebAssemblyJSRuntime.Instance.InvokeAsync("import", "/_framework/blazor-hotreload.js")); await jsObjectReference.InvokeUnmarshalled>("receiveHotReload"); }