Unexpected token 'export'
ZerdoX-x opened this issue · 1 comments
ZerdoX-x commented
Checks
- Not a duplicate.
- Not a question, feature request, or anything other than a bug report directly related to Svelte Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions
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
- Scaffold sveltekit project
- Install
@splidejs/svelte-splide
- Import components, see error
Expected Behaviour
No error
ZerdoX-x commented
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.