Search code examples
angularcordovaionic-frameworkplugins

Error in Ionic project: Uncaught Error: Type Storage does not have 'ɵmod' property"


I started a new project in Ionic 6.13.1. So, i added the plugin storage:

ionic cordova plugin add cordova-sqlite-storage

npm install --save @ionic/storage

In app.module.ts i wrote:

import { IonicStorageModule } from '@ionic/storage';

but IonicStorageModule was not recognized, only Storage was.

When i declare Storage in Imports section and run

ionic serve

there was an error: "Uncaught Error: Type Storage does not have 'ɵmod' property".

I did not wrote any other line in code, only this ones.

How can i solve this? Thanks


Solution

  • For Angular-based Ionic apps using Ionic storage, you have to use the storage-angular library.

    npm install @ionic/storage-angular
    

    Here is a link to the Ionic Storage documentation for additional information