title: Angular: Swiper carousel is not working - Error: node_modules/swiper/angular/angular/src/swiper-events.d.ts
body: <p>I am trying to create a carousel in angular using swiper (<a href="https://swiperjs.com/angular" rel="noreferrer">https://swiperjs.com/angular</a>).</p>
  <p>I get this error:</p>
  <p><strong>Error: node_modules/swiper/angular/angular/src/swiper-events.d.ts:3:50 - error TS2344: Type 'SwiperEvents[Property]' does not satisfy the constraint '(...args: any) =&gt; any'.
  Type '((swiper: Swiper) =&gt; void) | ((swiper: Swiper) =&gt; void) | ((swiper: Swiper) =&gt; void) | ((swiper: Swiper) =&gt; void) | ((swiper: Swiper) =&gt; void) | ((swiper: Swiper) =&gt; void) | ... 75 more ... | undefined' is not assignable to type '(...args: any) =&gt; any'.
  Type 'undefined' is not assignable to type '(...args: any) =&gt; any'.</strong></p>
  <p>I have tried this:</p>
  <p>-Uninstall and install again swiper with npm i swiper</p>
  <p>-Uninstall swiper and install it again with npm i @types/swiper</p>
  <p>Here is my code:</p>
  <p><strong>angular.json</strong></p>
  <pre><code>    &quot;styles&quot;: [
        &quot;src/myTheme.scss&quot;,
        &quot;src/styles.css&quot;,
        &quot;node_modules/swiper/swiper-bundle.min.css&quot;
      ],
      &quot;scripts&quot;: [&quot;node_modules/swiper/swiper-bundle.min.js&quot;]
    },
  </code></pre>
  <p><strong>The shared module</strong></p>
  <pre><code>import { SwiperModule } from 'swiper/angular';
    exports: [
      SwiperModule,
      other modules
    ]
  </code></pre>
  <p><strong>the component:</strong></p>
  <pre><code>  config: SwiperOptions = {
      slidesPerView: 3,
      spaceBetween: 50,
      navigation: true,
      pagination: { clickable: true },
      scrollbar: { draggable: true },
    };
  
  //in the methods
    onSwiper([swiper]) {
      console.log(swiper);
    }
    onSlideChange() {
      console.log('slide change');
    }
  </code></pre>
  <p><strong>the HTLM</strong></p>
  <pre><code>&lt;swiper
        [config]=&quot;config&quot;
        (swiper)=&quot;onSwiper($event)&quot;
        (slideChange)=&quot;onSlideChange()&quot;
      &gt;
    &lt;ng-template swiperSlide&gt;Slide 1&lt;/ng-template&gt;
    &lt;ng-template swiperSlide&gt;Slide 2&lt;/ng-template&gt;
    &lt;ng-template swiperSlide&gt;Slide 3&lt;/ng-template&gt;
    &lt;ng-template swiperSlide&gt;Slide 4&lt;/ng-template&gt;
    &lt;ng-template swiperSlide&gt;Slide 5&lt;/ng-template&gt;
    &lt;ng-template swiperSlide&gt;Slide 6&lt;/ng-template&gt;
  &lt;/swiper&gt;
  </code></pre>
  <p>does sb have an idea of what is hapenning??
  Thanks</p>