Splidejs / svelte-splide

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

[vite] Error when evaluating SSR module /node_modules/@splidejs/svelte-splide #3

Closed hrdlnk closed 2 years ago

hrdlnk commented 2 years ago

Checks

Version

0.1.15

Description

npm run dev yields:

[vite] Error when evaluating SSR module /node_modules/@splidejs/svelte-splide/components/Splide/Splide.svelte:
TypeError: Cannot read properties of null (reading 'name')
    at /private/tmp/my-app/node_modules/vite/dist/node/chunks/dep-7e125991.js:56752:62
    at Array.forEach (<anonymous>)
    at Object.enter (/private/tmp/my-app/node_modules/vite/dist/node/chunks/dep-7e125991.js:56751:42)
    at SyncWalker.visit (/private/tmp/my-app/node_modules/vite/dist/node/chunks/dep-7e125991.js:26522:16)
    at SyncWalker.visit (/private/tmp/my-app/node_modules/vite/dist/node/chunks/dep-7e125991.js:26552:18)
    at SyncWalker.visit (/private/tmp/my-app/node_modules/vite/dist/node/chunks/dep-7e125991.js:26552:18)
    at SyncWalker.visit (/private/tmp/my-app/node_modules/vite/dist/node/chunks/dep-7e125991.js:26559:11)
    at SyncWalker.visit (/private/tmp/my-app/node_modules/vite/dist/node/chunks/dep-7e125991.js:26552:18)
    at SyncWalker.visit (/private/tmp/my-app/node_modules/vite/dist/node/chunks/dep-7e125991.js:26559:11)
    at SyncWalker.visit (/private/tmp/my-app/node_modules/vite/dist/node/chunks/dep-7e125991.js:26552:18)

Reproduction Link

No response

Steps to Reproduce

$ npm init svelte@next my-app
$ cd my-app
$ npm install @splidejs/svelte-splide
$ npm run dev

routes/index.svelte

<script>
    import { Splide, SplideSlide } from '@splidejs/svelte-splide';
    import '@splidejs/splide/dist/css/themes/splide-default.min.css';
</script>

<Splide>
    <SplideSlide>Foo</SplideSlide>
    <SplideSlide>Bar</SplideSlide>
</Splide>

Expected Behaviour

No broken process

Robak08 commented 2 years ago

Have You tried installing Splide as dev dependency? Haven't been using sveltekit since alpha, but its quite common among svelte ssr to install packages as dev deps. On routify v2 (svelte framework) works like a charm.

NaotoshiFujita commented 2 years ago

@Robak08 thanks!