'ion-popover'/'ion-modal' is not a known element

Hello, I get this error in my project when trying to use ‘ion-popover’ or ‘ion-modal’ with ionic 5:
Error: src/app/help/help.page.html:22:3 - error NG8001: 'ion-modal' is not a known element...

All other ionic components work properly

Some solutions I tried, none helped:

  • I tried creating a new page and using the elements in it, still get the same error.
  • I checked that I have imports: [CommonModule, IonicModule] in the module files.
  • Updated to the latest @ionic-angular 5 version
  • Ran npm install
  • Made sure that all pages have a route
  • Restarted ionic serve
  • Tried ion-select with interface=“popover”, still opens as alert

This is my ionic environment:

Ionic CLI                     : 6.17.1 (C:\Users\gelet\AppData\Roaming\npm\node_modules\@ionic\cli)
Ionic Framework               : @ionic/angular 5.9.3
@angular-devkit/build-angular : 12.1.4
@angular-devkit/schematics    : 12.1.4
@angular/cli                  : 12.1.4
@ionic/angular-toolkit        : 4.0.0



Ion-modal inline in html is ionic 6, not 5

So either upgrade to 6, or use modalcontroller

At least, that I believe is the issue