From e51948e4addcd6300147db0a53acef42ec4297eb Mon Sep 17 00:00:00 2001 From: Mackinnon Buck <mackinnon.buck@gmail.com> Date: Thu, 9 Jun 2022 13:55:57 -0700 Subject: [PATCH] Fixed boot config issue. (#41976) (#41992) --- src/Components/Web.JS/src/Platform/BootConfig.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Components/Web.JS/src/Platform/BootConfig.ts b/src/Components/Web.JS/src/Platform/BootConfig.ts index 4e5c22dfd8f..b752a74981e 100644 --- a/src/Components/Web.JS/src/Platform/BootConfig.ts +++ b/src/Components/Web.JS/src/Platform/BootConfig.ts @@ -12,9 +12,15 @@ export class BootConfigResult { loadBootResource('manifest', 'blazor.boot.json', '_framework/blazor.boot.json', '') : defaultLoadBlazorBootJson('_framework/blazor.boot.json'); - const bootConfigResponse = loaderResponse instanceof Promise ? - await loaderResponse : - await defaultLoadBlazorBootJson(loaderResponse ?? '_framework/blazor.boot.json'); + let bootConfigResponse: Response; + + if (!loaderResponse) { + bootConfigResponse = await defaultLoadBlazorBootJson('_framework/blazor.boot.json'); + } else if (typeof loaderResponse === 'string') { + bootConfigResponse = await defaultLoadBlazorBootJson(loaderResponse); + } else { + bootConfigResponse = await loaderResponse; + } // While we can expect an ASP.NET Core hosted application to include the environment, other // hosts may not. Assume 'Production' in the absence of any specified value. -- GitLab