Closed mcmxcdev closed 2 years ago
Why does your Splide.svelte
component contain <p>
tag? I did not use the tag at all.
Here is the component code:
{ #if hasSliderWrapper }
<slot name="before-slider"/> // line 97 on your error
{ /if }
// line 99 where your error occurs
{ #if hasSliderWrapper }
<div class="splide__slider">
<slot name="before-track"/>
<div class="splide__track">
<ul class="splide__list">
<slot/>
</ul>
</div>
<slot name="after-track"/>
</div>
{ :else }
<slot name="before-track"/>
<div class="splide__track">
<ul class="splide__list">
<slot/>
</ul>
</div>
<slot name="after-track"/>
{ /if }
Yeah, I was wondering about that too when looking at the source code.
I think this was some kind of mess-up with Vite HMR and node_modules
. I reinstalled the dependencies, and it seems to be fixed now, and I cannot reproduce the issue anymore.
Thank you!
Checks
Version
0.1.18
Description
There are actually two issues that I encounter when using Splide with SvelteKit.
It is incompatible with SSR, so I need to wrap the component in an if check for the browser environment.
Additionally, the application breaks with the following error:
The code that I am using looks like this:
I also tried with other example code but it always breaks.
Reproduction Link
No response
Steps to Reproduce
Expected Behaviour
Splide works as expected with SvelteKit.