From 8a8fb625a9ce2fc543e0aa8d81c1aed1e0b19c8f Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Mon, 5 Apr 2021 15:38:41 +0300 Subject: [PATCH] fix(svelte): don't destroy on server-side ref #3961 --- src/svelte/swiper.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } });