Closed JeffWScott closed 1 year ago
Same problem. Any luck?
what works is this:
let Carousel: ConstructorOfATypedSvelteComponent; // for saving Carousel component class
onMount(async () => {
const module = await import('svelte-carousel');
Carousel = module.default;
});
and then later
{#if browser}
<svelte:component
this={Carousel}
autoplay
autoplayDuration={4000}
duration={500}
dots={true}
arrows={false}
>
...
</svelte:component>
{/if}
but obviously it would be great if the component were working without tricks
update to new sveltekit (1.0.0) and don't forget to update vite too (v.4.0.0)
should be solved then (although there's still awarinng about a missing "type:module" in package.json of this component. :)
The error for the missing type: module
svelte-carousel doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.
I can work on this issue
what works is this:
let Carousel: ConstructorOfATypedSvelteComponent; // for saving Carousel component class onMount(async () => { const module = await import('svelte-carousel'); Carousel = module.default; });
and then later
{#if browser} <svelte:component this={Carousel} autoplay autoplayDuration={4000} duration={500} dots={true} arrows={false} > ... </svelte:component> {/if}
but obviously it would be great if the component were working without tricks
it's works thank you
Should be fixed in https://github.com/vadimkorr/svelte-carousel/pull/126
Followed instructions for svelte kit install. Which are also out of date because kit.vite is no longer a config option.