svelte-carousel icon indicating copy to clipboard operation
svelte-carousel copied to clipboard

lodash.isequal does not provide an export named 'default'

Open jhubbardsf opened this issue 3 years ago • 1 comments

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. Screen Shot 2022-02-25 at 4 15 02 PM

jhubbardsf avatar Feb 25 '22 21:02 jhubbardsf

maybe you must put the config like this `

  const config = {
      kit: {
	      adapter: adapter(),
	      vite: {
		      optimizeDeps: {
			      include: ['lodash.get', 'lodash.isequal', 'lodash.clonedeep']
		      },
		      // plugins: [myPlugin]
	      }
      },
  };

`

aditiakusuma avatar Feb 26 '22 12:02 aditiakusuma

Resolved

vadimkorr avatar Sep 03 '22 10:09 vadimkorr

Just confirmed that using pnpm causes the same problem but using npm works.

kinxiel avatar Nov 04 '22 17:11 kinxiel