From 52e860e0802008576ac37dd6804ed90152bc1fda Mon Sep 17 00:00:00 2001 From: zhangyuang Date: Thu, 22 Jul 2021 23:51:48 +0800 Subject: [PATCH 1/2] fix: fix server side judge (close #4787) --- src/utils/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index e61989a4a..805722dd4 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -94,7 +94,7 @@ function isObject(o) { } function isNode(node) { // eslint-disable-next-line - if (typeof window !== 'undefined') { + if (typeof window !== 'undefined' && typeof window.screen !== 'undefined') { return node instanceof HTMLElement; } return node && (node.nodeType === 1 || node.nodeType === 11); From a0e4b4f68d6b8286bd52d4750230373a43866087 Mon Sep 17 00:00:00 2001 From: zhangyuang Date: Fri, 23 Jul 2021 00:22:43 +0800 Subject: [PATCH 2/2] fix: use window.HTMLElement judge (close #4787) --- src/utils/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index 805722dd4..59d827435 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -94,7 +94,7 @@ function isObject(o) { } function isNode(node) { // eslint-disable-next-line - if (typeof window !== 'undefined' && typeof window.screen !== 'undefined') { + if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') { return node instanceof HTMLElement; } return node && (node.nodeType === 1 || node.nodeType === 11);