From da29d885b741c2cbdee048489233ee93943a6488 Mon Sep 17 00:00:00 2001 From: Rafael Fernandez Serra Date: Mon, 6 Jan 2020 14:32:44 +0000 Subject: [PATCH] fix(safeConsole): check if document is defined to avoid issues in node environments --- src/common/safeConsole.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/safeConsole.ts b/src/common/safeConsole.ts index 3b0b0dc1..7d46ec89 100644 --- a/src/common/safeConsole.ts +++ b/src/common/safeConsole.ts @@ -22,7 +22,7 @@ function fallbackConsole(console) { function getSafeConsole() { // @ts-ignore - const isIE9 = document && document.documentMode && document.documentMode === 9; + const isIE9 = typeof document !== 'undefined' && document.documentMode && document.documentMode === 9; if (isIE9) { return window && window.console ? ie9Console(window.console) : noopConsoleStub; } else if (!console.table || !console.error) {