This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch fix/docs-alert-ssr-window-error
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 2c9a9439871fca2b5447f1f5896047f261b2c1af
Author: Evan Rusackas <[email protected]>
AuthorDate: Mon Feb 23 17:21:37 2026 -0800

    fix(docs): guard window reference in logging.ts for SSR compatibility
    
    The `utils/logging.ts` module referenced `window.console` directly at
    module initialization with no SSR guard. During Docusaurus SSG builds,
    this module gets evaluated in Node.js (via the import chain:
    Alert -> translation -> Translator -> logging), causing
    "window is not defined" and failing the docs build for all PRs.
    
    Use `typeof window !== 'undefined'` guard with `globalThis.console`
    fallback for Node.js environments.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 superset-frontend/packages/superset-core/src/utils/logging.ts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/packages/superset-core/src/utils/logging.ts 
b/superset-frontend/packages/superset-core/src/utils/logging.ts
index 230dbdf2bdd..dd122cc9a80 100644
--- a/superset-frontend/packages/superset-core/src/utils/logging.ts
+++ b/superset-frontend/packages/superset-core/src/utils/logging.ts
@@ -17,7 +17,8 @@
  * under the License.
  */
 
-const console = window.console || {};
+const console =
+  typeof window !== 'undefined' ? window.console || {} : globalThis.console;
 const log = console.log || (() => {});
 
 const logger = {

Reply via email to