From 88799e61fdf60dc313ef2c6b15ab2458240895a4 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 31 Aug 2018 10:24:16 +0100 Subject: [PATCH] Add exit clause for static builds --- src/utils/patchDOMForGoogleTranslate.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/patchDOMForGoogleTranslate.js b/src/utils/patchDOMForGoogleTranslate.js index 8f00548b3..5c4854e55 100644 --- a/src/utils/patchDOMForGoogleTranslate.js +++ b/src/utils/patchDOMForGoogleTranslate.js @@ -11,6 +11,10 @@ // https://github.com/facebook/react/issues/12460 export default function patchDOMForGoogleTranslate() { + if (typeof Node !== 'function' || Node.prototype == null) { + return; + } + const originalRemoveChild = Node.prototype.removeChild; // $FlowFixMe Intentionally monkepatching. Node.prototype.removeChild = function(child) {