Splidejs / svelte-splide

Svelte component for the Splide slider/carousel.
https://splidejs.com/
MIT License
82 stars 9 forks source link

Unexpected token 'export' #11

Closed ZerdoX-x closed 9 months ago

ZerdoX-x commented 1 year ago

Checks

Version

0.2.9

Description

Running sveltekit in default mode.

import { Splide, SplideSlide, SplideTrack } from "@splidejs/svelte-splide";

Causes Unexpected token 'export' and error 500


Though code below works ok.

import Splide from "@splidejs/svelte-splide/components/Splide/Splide.svelte";
import SplideSlide from "@splidejs/svelte-splide/components/SplideSlide/SplideSlide.svelte";
import SplideTrack from "@splidejs/svelte-splide/components/SplideTrack/SplideTrack.svelte";

To workaround I tried to move svelte-splide from dependencies to devDependencies, then it works as expected. Is this intended behavior?

Reproduction Link

No response

Steps to Reproduce

  1. Scaffold sveltekit project
  2. Install @splidejs/svelte-splide
  3. Import components, see error

Expected Behaviour

No error

ZerdoX-x commented 9 months ago

I think it's common for sveltekit projects to have dependencies in devDependencies instead. Not sure why it does work like this, but this is not the first project I encounter with similar issue. Ping me if you have any extra useful info and want me to reopen this.