我正在使用 pouchDb +ionic 3。在使用 ionic 3 创建 pouchDb 时没有提及任何参数(默认情况下:websql),它工作正常。但是每当我尝试像这样使用适配器(indexedDB)时:
setupDB() {
this.db = new PouchDB('Contacts', {adapter : 'idb'});
}
它抛出了一个错误:
ERROR Error: Invalid Adapter: idb
at new PouchDB$5 (VM46 vendor.js:118540)
请帮助。
最佳答案
我认为这是一个专门针对 iOS 移动设备的已知问题。 您可以在该线程中看到正在讨论的内容: https://github.com/pouchdb/pouchdb/issues/6946
似乎修复正在进行中: https://github.com/pouchdb/pouchdb/issues/7085
所以我们应该尽快升级,这有望解决它。
更新:另请确保您的 iOS 浏览器未处于隐身模式。这种模式不允许数据持久化。
关于javascript - 错误 : Invalid Adapter :idb in pouchdb + ionic 3 with using chrome (Version 63. 0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48376650/