0

Problem:

In my Angular 8 projects, I have used ngx-swiper-wrapper but after running, I get the following error in the console: k.children is not function.

The issue is located in these lines of code.

ngAfterViewInit() {
           
    this.swiper = new Swiper('.swiper-container', {
             
    });
}

This is the error showing in the browser.

core.js.pre-build-optimizer.js:7187 ERROR TypeError: k.children is not a function at new e (swiper.esm.js.pre-build-optimizer.js:3229) at demo.component.ts:37 at a.invokeTask (zone-evergreen.js.pre-build-optimizer.js:391) at Object.onInvokeTask (core.js.pre-build-optimizer.js:30885) at a.invokeTask (zone-evergreen.js.pre-build-optimizer.js:390) at t.runTask (zone-evergreen.js.pre-build-optimizer.js:168) at invokeTask (zone-evergreen.js.pre-build-optimizer.js:465) at invoke (zone-evergreen.js.pre-build-optimizer.js:454) at n.args. (zone-evergreen.js.pre-build-optimizer.js:2650)

Can someone help me to solve this issue? I tried a lot to find out a solution but I have no idea where this k.children is coming from. Thank you.

  • Why is you selector in parenthesis ? It looks like you were trying to do a jquery selector, without the `$`. – Nicolas Aug 19 '20 at 00:03
  • @Nicolas I have tried the example with element ref but the Issue was the same . So when I copy the code it came with those parenthesis so I edited the question – Tharindu Sandaruwan Aug 19 '20 at 00:09

0 Answers0