ionic-storage: promises don't resolve and driver is null
Hi there,
Happy new year 😉
So I’m trying to use IonicStorage in a ionic 4 app, I’m testing it in the browser, but the promises of ready, get and set methods never resolve, and when I log the driver with storage.driver, the result is null!
My config in my app.module.ts :
import { IonicStorageModule } from '@ionic/storage';
@NgModule({
...
imports: [
...
IonicStorageModule.forRoot({
name: '__mydb',
driverOrder: ['sqlite', 'indexeddb', 'websql', 'localstorage']
}),
]
...
I tried every kind of driverOrder, same result. So I may switch back to nativeStorage.
Any ideas? I’m already familiar with localForage.
Cheers
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 37 (9 by maintainers)
Commits related to this issue
- feat(ssr): provide noop driver in node environment for ssr — committed to ionic-team/ionic-storage by adamdbradley 5 years ago
In my case, this is due to the fact that I use
pouchdb
in my project, which requires to add a polyfill forprocess
:See https://github.com/pouchdb/pouchdb/issues/7263
So reverting to 2.2.0 fixes this issue, but then I can’t compile anymore with Angular 10 because this fix has been added in 2.3.0 🙂