diff --git a/src/backend/utils/view-helpers/view-helpers.ts b/src/backend/utils/view-helpers/view-helpers.ts index 1cb4bbfd4..2278fc0e4 100644 --- a/src/backend/utils/view-helpers/view-helpers.ts +++ b/src/backend/utils/view-helpers/view-helpers.ts @@ -11,6 +11,10 @@ try { if (error.message !== 'window is not defined') { throw error } +} finally { + if (!globalAny) { + globalAny = {} + } } /** diff --git a/src/frontend/utils/api-client.ts b/src/frontend/utils/api-client.ts index 952d72dda..ccebdbe36 100644 --- a/src/frontend/utils/api-client.ts +++ b/src/frontend/utils/api-client.ts @@ -19,6 +19,10 @@ try { } else { globalAny = { isOnServer: true } } +} finally { + if (!globalAny) { + globalAny = { isOnServer: true } + } } /**