From c35355a490a1c07ae002df1e67fe56ad0d73be91 Mon Sep 17 00:00:00 2001 From: Berk Date: Wed, 27 May 2026 05:12:00 +0300 Subject: [PATCH] fix(client): silence noisy LangSelector not found console warning (#4021) ## Description: Silence noisy console warnings of `LangSelector not found in DOM` on page hydration. Previously, `translateText()` queried the DOM very early in the client rendering/hydration phase before Lit Element had mounted the `` element. This resulted in hundreds of noisy warnings in the browser developer console on page load. This fix resolves the issue gracefully in Utils.ts: it queries `getCachedLangSelector()` and immediately returns the key if not found without polluting the console log with warnings. Once the element is fully mounted, normal translation and cache updates resume. ## Please complete the following: - [X] I have added screenshots for all UI updates - [X] I process any text displayed to the user through translateText() and I've added it to the en.json file - [X] I have added relevant tests to the test directory - [X] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: barfires --- src/client/Utils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/Utils.ts b/src/client/Utils.ts index 3ecd016af..c4708cb55 100644 --- a/src/client/Utils.ts +++ b/src/client/Utils.ts @@ -428,7 +428,6 @@ export const translateText = ( const langSelector = getCachedLangSelector(); if (!langSelector) { - console.warn("LangSelector not found in DOM"); return key; }