1

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

2 Answers 2

2

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

1

I was searching for the same problem, and the previously accepted answer from Rich Tillis is correct, but for beginners like me maybe not obvious:

According to the docs, also linked above, you should do the import in app.module.ts as follows:

Note: pay attention to the import: @ionic/storage-angular So basically everything stays the same, except the import. Well done ionic :)

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

@NgModule({
  imports: [
    IonicStorageModule.forRoot()
  ]
})
export class AppModule { }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.