diff --git a/src/svelte/swiper.svelte b/src/svelte/swiper.svelte index 02dcd2650..ed366633f 100644 --- a/src/svelte/swiper.svelte +++ b/src/svelte/swiper.svelte @@ -132,7 +132,7 @@ }); onDestroy(() => { - if (swiperInstance && !swiperInstance.destroyed) { + if (typeof window !== 'undefined' && swiperInstance && !swiperInstance.destroyed) { swiperInstance.destroy(true, false); } });