Ionic2 - storage example fails with "not macht any signature"


#1

Hi,

I am trying to add the storage module to my project based on the API

import { Storage } from '@ionic/storage';
export function provideStorage() {
  return new Storage(['sqlite', 'websql', 'indexeddb'], { name: '_myDB' });// optional config);
}

providers: [{provide: ErrorHandler, useClass: IonicErrorHandler},{ provide: Storage, useFactory: provideStorage }]

but it fails with:

[13:11:57]  typescript: src/app/app.module.ts, line: 17 
            Supplied parameters do not match any signature of call target. 

      L16:  export function provideStorage() {
[13:11:57]  typescript: src/services/user-service.ts, line: 19 
      L17:    return new Storage(['sqlite', 'websql', 'indexeddb'], { name: '_myDB' });// optional config);

I installed sqlite beforehand.


#2

Update @ionic/storage to 1.1.7 version in your package.json :slight_smile:


#3

Ok, seems I have 1.1.6 here. How do I update the package to that specific version?