Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Please note: This is not the same as the 404 for blazor-hotreload.js
, which has been fixed with #36897, but this is the second part of #35555 which I believe was missed.
The fetch request for _framework/blazor-hotreload
from blazor-hotreload.js
returns 404 due to the url being relative to the subdirectory, contents of blazor-hotreload.js
:
export function receiveHotReload() {
return BINDING.js_to_mono_obj(new Promise((resolve) => receiveHotReloadAsync().then(resolve(0))));
}
async function receiveHotReloadAsync() {
const cache = window.sessionStorage.getItem('blazor-webassembly-cache');
let headers;
if (cache) {
headers = { 'if-none-match' : cache.etag };
}
const response = await fetch('_framework/blazor-hotreload', { headers });
if (response.status === 200) {
const deltas = await response.json();
if (deltas) {
try {
deltas.forEach(d => window.Blazor._internal.applyHotReload(d.moduleId, d.metadataDelta, d.ilDelta));
} catch (error) {
console.warn(error);
return;
}
}
}
}
Expected Behavior
blazor-hotreload
should load successfully and hot reload should work
Steps To Reproduce
- Create a hosted ASP.NET Core + Blazor WebAssembly Project
- Configure it to operate under a subdirectory (set base href, StaticWebAssetBasePath etc)
- Run the hosted project.
- Observe that
blazor-hotreload.js
loads correctly but requests_framework/blazor-hotreload
(relative to the subdirectory), breaking hot reload.
Repro: https://github.com/crackalak/BlazorHotReload404
Exceptions (if any)
No response
.NET Version
6.0.201