From 222fcd5e2a3f1d9af3a5f78ee6d01eac77c1fc04 Mon Sep 17 00:00:00 2001 From: Justin Brumley Date: Tue, 23 Jun 2020 17:45:35 -0500 Subject: [PATCH] fix: check that window exists before defining CustomEvent --- src/polyfill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/polyfill.js b/src/polyfill.js index 3c08c3e3e..a234ee5e0 100644 --- a/src/polyfill.js +++ b/src/polyfill.js @@ -1,5 +1,5 @@ (() => { - if ( typeof window.CustomEvent === 'function' ) return; + if ( typeof window !== 'object' || typeof window.CustomEvent === 'function' ) return; const CustomEvent = (( event, params ) => { params = params || { bubbles: false, cancelable: false, detail: null };