From 913078d9408d3f2efda6f39cf563c1dbb6887701 Mon Sep 17 00:00:00 2001 From: Ryan Miller Date: Tue, 27 Aug 2024 12:04:35 +1000 Subject: [PATCH] fix: update strings feature flag to be ignored by node when no window exists --- ts/util/i18n/functions/getRawMessage.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts/util/i18n/functions/getRawMessage.ts b/ts/util/i18n/functions/getRawMessage.ts index 7d41c09a9..cf7e45672 100644 --- a/ts/util/i18n/functions/getRawMessage.ts +++ b/ts/util/i18n/functions/getRawMessage.ts @@ -60,7 +60,10 @@ export function getRawMessage< R extends DictionaryWithoutPluralStrings[T], >(...[token, args]: GetMessageArgs): R | T { try { - if (window?.sessionFeatureFlags?.replaceLocalizedStringsWithKeys) { + if ( + typeof window !== 'undefined' && + window?.sessionFeatureFlags?.replaceLocalizedStringsWithKeys + ) { return token as T; }