Skip to content

Commit da29d88

Browse files
Rafael Fernandez Serramergify[bot]
Rafael Fernandez Serra
authored andcommittedJan 6, 2020
fix(safeConsole): check if document is defined to avoid issues in node environments
1 parent 244effb commit da29d88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/common/safeConsole.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function fallbackConsole(console) {
2222

2323
function getSafeConsole() {
2424
// @ts-ignore
25-
const isIE9 = document && document.documentMode && document.documentMode === 9;
25+
const isIE9 = typeof document !== 'undefined' && document.documentMode && document.documentMode === 9;
2626
if (isIE9) {
2727
return window && window.console ? ie9Console(window.console) : noopConsoleStub;
2828
} else if (!console.table || !console.error) {

0 commit comments

Comments
 (0)
Please sign in to comment.