Open webspilka opened 5 years ago
@webspilka , same here with nuxt. i guess that't because ur code execute on server side.
@webspilka did you solve this? onMount should mean it only runs client side, but i feel the import itself is causing the issue
@matt3224 @webspilka I wrote this section of the manual for this exact reason:
https://sapper.svelte.dev/docs#Making_a_component_SSR_compatible
any import which immediately tries to use the DOM will fail when it runs server-side. Using a dynamic import (await import('stuff')) is the solution for this.
@webspilka, @antony is absolutely correct and I can confirm the above works as explained. We should have looked at the docs better, you know, with our eyes
Also this PR https://github.com/ganlanyuan/tiny-slider/pull/479 means this wouldn't be an issue, works too!
Issue description:
I try load tiny-slider in my svelte/sapper component https://sapper.svelte.dev and get error
Demo link/slider setting:
Tiny-slider version: 2.9.2 Browser name && version: chrome last OS name && version: mac os