Search code examples
angularionic-frameworkionic6

ionic-selectable not compatible with angular ivy


I want to install ionic-selectable on my project using ionic 6, tried installing ionic-selectable 4.9.0 and it was successful, but when importing it I encounter the error.

IonicSelectableModule does not appear to be an NgModule class This likely means that the library (ionic-selectable) which declares IonicSelectableModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy

I am currently trying other option for the component, but it is not easy to find the alternative that fits my need (currently trying ng-select)


Solution

  • I have solved this in ionic 7 to change following: remove declearation from "imports" array and paste it into "providers" array in app.module.ts.

    @NgModule({
      imports: [
        IonicSelectableModule // remove from here
      ],
      providers: [
        IonicSelectableModule // paste here
      ]
    })