svelte-carousel
svelte-carousel copied to clipboard
lodash.isequal does not provide an export named 'default'
Trying to get Svelte-Carousel working in my SvelteKit application. Currently running into some issues. I have svelte-carousel installed as a devDependency. This is my svelte.config file.
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess(),
kit: {
adapter: adapter(),
vite: {
plugins: [WindiCSS.default()],
vite: {
optimizeDeps: {
include: ['lodash.get', 'lodash.isequal', 'lodash.clonedeep']
}
}
}
}
};
I created a carousel/index.svelte file with the following contents
<script>
import { onMount } from 'svelte';
let Carousel; // for saving Carousel component class
let carousel; // for calling methods of the carousel instance
onMount(async () => {
const module = await import('svelte-carousel');
Carousel = module.default;
});
const handleNextClick = () => {
carousel.goToNext()
}
</script>
<svelte:component
this={Carousel}
bind:this={carousel}
>
<div>1</div>
<div>2</div>
<div>3</div>
</svelte:component>
<button on:click={handleNextClick}>Next</button>
I get the following error when I try to go to the page.

maybe you must put the config like this `
const config = {
kit: {
adapter: adapter(),
vite: {
optimizeDeps: {
include: ['lodash.get', 'lodash.isequal', 'lodash.clonedeep']
},
// plugins: [myPlugin]
}
},
};
`
Resolved
Just confirmed that using pnpm causes the same problem but using npm works.