Skip to content

Commit 8eb3046

Browse files
authored
fix(docs): guard window reference in logging.ts for SSR compatibility (apache#38201)
1 parent 615f134 commit 8eb3046

File tree

1 file changed

+2
-1
lines changed
  • superset-frontend/packages/superset-core/src/utils

1 file changed

+2
-1
lines changed

superset-frontend/packages/superset-core/src/utils/logging.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
* under the License.
1818
*/
1919

20-
const console = window.console || {};
20+
const console =
21+
typeof window !== 'undefined' ? window.console || {} : globalThis.console;
2122
const log = console.log || (() => {});
2223

2324
const logger = {

0 commit comments

Comments
 (0)