'IonicStorageModule' has no exported member


#1

Hi, I am new to ionic 2. I am working with ionic version 2.2.1. I want to use sqllite to store my login state.
I followed this (https://ionicframework.com/docs/v2/storage/). But after doing this my app is not working.
when I run ionic serve it will give below error

[23:06:26] build started …
[23:06:26] transpile started …
[23:06:33] typescript: G:/Mobile Project/xxx/src/app/app.module.ts, lin
e: 3
Module ‘“G:/Mobile Project/yowunpuraya/node_modules/@ionic/storage/e
s2015/index”’ has no exported member
’IonicStorageModule’.

   L2:  import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angu

lar’;
L3: import { IonicStorageModule } from ‘@ionic/storage’;
L4: import { MyApp } from ‘./app.component’;

[23:06:33] transpile failed
[23:06:33] build finished in 7.10 s

I am running on windows machine. please help me


#2

this did it for me.


#3

@clew24 I was having similar problem today and your post helped me. Thanks!


#4

its work for me. Thank you!!


#5

Hi…Thanks for your help. It works fine in pages but not in providers of ionic 2


#6

No you still use { IonicStorage } in pages and providers. but you must change the on in app.module.ts to { IonicStorageModule } and add IonicStorageModule.forRoot() to the imports array in app.module.ts instead of where it was which was the constructor or the providers.


#7

I believe that’s just Storage.


#8

He is right. I use Storage while in the pages and providers. The other part is what has changed. Good call. I was going through it fast and didn’t notice that I put { IonicStorage } instead of { Storage }


#9

Use:

import { Storage } from ‘@ionic/storage’;

@NgModule({
declarations: [
// …
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
// …
],
providers: [
Storage
]
})
export class AppModule {}


#10

Please disregard the previous post.