Splidejs/svelte-splide

Unexpected token 'export'

ZerdoX-x opened this issue · 1 comments

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

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.