# Ionic Storage problem

**URL:** <https://forum.ionicframework.com/t/ionic-storage-problem/97509>\
**Category:** ionic-v3\
**Created:** [July 9, 2017, 5:12pm UTC](https://forum.ionicframework.com/t/ionic-storage-problem/97509 "2017-07-09T17:12:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DerpoRex](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@DerpoRex](https://forum.ionicframework.com/u/DerpoRex)\
**Post date:** [July 9, 2017, 5:12pm UTC](https://forum.ionicframework.com/t/ionic-storage-problem/97509/1 "2017-07-09T17:12:47Z")

</div>

With this code I always get the error: All declarations of ‘storage’ must have identical modifiers’

```auto
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';

import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';

import {IonicStorageModule} from '@ionic/storage'

@NgModule({
  declarations: [
    MyApp,
    HomePage
  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot()
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

```

```auto
import { Storage } from '@ionic/storage';

export class MyApp {
  constructor(private storage: Storage) { }

  storage.set('item1', 'item');

  storage.get('item2').then((val) => {
    console.log('Your age is', val);
  });
}

```

note: I got the code from the ionic docs

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [July 9, 2017, 8:58pm UTC](https://forum.ionicframework.com/t/ionic-storage-problem/97509/2 "2017-07-09T20:58:02Z")

</div>

Do you have “Storage” anywhere else?  
What is your `ionic info`?

---

<div class="post-metadata">

**Author:** ![DerpoRex](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@DerpoRex](https://forum.ionicframework.com/u/DerpoRex)\
**Post date:** [July 10, 2017, 2:12am UTC](https://forum.ionicframework.com/t/ionic-storage-problem/97509/3 "2017-07-10T02:12:17Z")

</div>

I do not have storage anywhere else

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [July 10, 2017, 8:32am UTC](https://forum.ionicframework.com/t/ionic-storage-problem/97509/4 "2017-07-10T08:32:37Z")

</div>

Please create a new project with `ionic start` and do only the exact things the docs tell you. Does it work then or do you get the same error? If you still get the error, please upload the whole project to Github and post the link so we can check the exact code.

---

<div class="post-metadata">

**Author:** ![DerpoRex](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@DerpoRex](https://forum.ionicframework.com/u/DerpoRex)\
**Post date:** [July 10, 2017, 7:36pm UTC](https://forum.ionicframework.com/t/ionic-storage-problem/97509/5 "2017-07-10T19:36:22Z")

</div>

Yes it works! Thank you
