ionic-selectable not compatible with angular ivy

181 views Asked by At

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)

2

There are 2 answers

0
Meeran Ismail On

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
  ]
})
0
Sebastián Gómez On

You can try doing the following:

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

@NgModule({
  imports: [],
  providers: [
    IonicSelectableModule,
  ],
  declarations: [],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
})