Ionic Storage + IndexedDB not working

#1

When I am trying to use Ionic Storage with IndexedDB on Desktop Chrome, it always fails.

app.module.ts

@NgModule({
    declarations: [AppComponent],
    entryComponents: [],
    imports: [
        BrowserModule,
        IonicModule.forRoot({
            mode: 'ios'
        }),
        AppRoutingModule,

        // storage
        IonicStorageModule.forRoot({
            name: 'mydb',
            driverOrder: ['indexeddb']
        }),

Operations:

import {Storage} from '@ionic/storage';
constructor(private storage: Storage){}

...

this.storage.set('name', 'someone').then(async () => {
            console.log(await this.storage.get('name'));
        });

Got this error and failed

Anyone could help? thanks!

1 Like
#2

same problem ! have solved ?