Skip to content

Commit e51948e

Browse files
Fixed boot config issue. (#41976) (#41992)
1 parent f9e44c9 commit e51948e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Components/Web.JS/src/Platform/BootConfig.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@ export class BootConfigResult {
1212
loadBootResource('manifest', 'blazor.boot.json', '_framework/blazor.boot.json', '') :
1313
defaultLoadBlazorBootJson('_framework/blazor.boot.json');
1414

15-
const bootConfigResponse = loaderResponse instanceof Promise ?
16-
await loaderResponse :
17-
await defaultLoadBlazorBootJson(loaderResponse ?? '_framework/blazor.boot.json');
15+
let bootConfigResponse: Response;
16+
17+
if (!loaderResponse) {
18+
bootConfigResponse = await defaultLoadBlazorBootJson('_framework/blazor.boot.json');
19+
} else if (typeof loaderResponse === 'string') {
20+
bootConfigResponse = await defaultLoadBlazorBootJson(loaderResponse);
21+
} else {
22+
bootConfigResponse = await loaderResponse;
23+
}
1824

1925
// While we can expect an ASP.NET Core hosted application to include the environment, other
2026
// hosts may not. Assume 'Production' in the absence of any specified value.

0 commit comments

Comments
 (0)