diff --git a/src/shared/dom.js b/src/shared/dom.js index 06b69ba217..d428e92f1c 100644 --- a/src/shared/dom.js +++ b/src/shared/dom.js @@ -234,7 +234,7 @@ export function addResizeListener(element, fn) { return { cancel: () => { - win && win.removeEventListener('resize', fn); + win && win.removeEventListener && win.removeEventListener('resize', fn); element.removeChild(object); } };