diff --git a/core/src/components/img/img.tsx b/core/src/components/img/img.tsx index 1f6977a7f7..80947ea17c 100644 --- a/core/src/components/img/img.tsx +++ b/core/src/components/img/img.tsx @@ -53,7 +53,11 @@ export class Img implements ComponentInterface { if (this.src === undefined) { return; } - if ('IntersectionObserver' in window) { + if ( + typeof (window as any) !== 'undefined' && + 'IntersectionObserver' in window && + 'IntersectionObserverEntry' in window && + 'isIntersecting' in window.IntersectionObserverEntry.prototype) { this.removeIO(); this.io = new IntersectionObserver(data => { // because there will only ever be one instance