diff --git a/src/countUp.ts b/src/countUp.ts index 9c32ba1..ac1a8ad 100644 --- a/src/countUp.ts +++ b/src/countUp.ts @@ -88,7 +88,7 @@ export class CountUp { } // scroll spy - if (window !== undefined && this.options.enableScrollSpy) { + if (typeof window !== 'undefined' && this.options.enableScrollSpy) { if (!this.error) { // set up global array of onscroll functions window['onScrollFns'] = window['onScrollFns'] || [];