[英]Adapter Missing Error on iOS9 - PouchDB
In continuation of my previous posts relating to a failure while replicating the remote CouchDB - I used the FruitDown Adapter: 在继续之前的与远程CouchDB复制有关的故障的后续文章中,我使用了FruitDown适配器:
My code is like: 我的代码是这样的:
PouchDB and Adapter referencing done on index.html as follows: 在index.html上完成PouchDB和Adapter的引用如下:
<script src="lib/pouchdb/pouchdb-5.1.0.min.js"></script>
<!-- FruitDown Adapter for iOS -->
<script src="lib/pouchdb/pouchdb.fruitdown.js"></script>
And a Factory that creates the Local & Remote data base references are as follows: 创建本地和远程数据库引用的工厂如下:
setLocalDb: function () {
local_db_name = 'local_db';
if (isIOS) {
local_db = new PouchDB (local_db_name, {adapter: 'fruitdown'});
} else {
local_db = new PouchDB (local_db_name);
}
}
setRemoteDb: function () {
remote_db_name = 'remote_db';
if (isIOS) {
remote_db = new PouchDB ('http://my_remote_address', {
auth: {username: 'admin', password: 'admin123'}, adapter: 'fruitdown'});
} else {
remote_db = new PouchDB ('http://my_remote_address, {
auth: {username: 'admin', password: 'admin123'}
});
}
}
With the above code - when I call a replicate()
method - the replication stops on the PAUSE block and Error shown as 'Error: Adapter is missing'
使用上面的代码-当我调用
replicate()
方法时-复制在PAUSE块上停止,并且错误显示为'Error: Adapter is missing'
Could you please guide where am I going wrong ?? 你能指导我哪里出错了吗?
That error means that the pouchdb.fruitdown.js
was not included on the page somehow. 该错误意味着该页面未包含
pouchdb.fruitdown.js
。 Can you double-check that it was loaded by printing out PouchDB.preferredAdapters
or Object.keys(PouchDB.adapters)
? 您可以通过打印出
PouchDB.preferredAdapters
或Object.keys(PouchDB.adapters)
来PouchDB.preferredAdapters
检查它是否已加载吗? It should contain ['idb', 'websql', 'fruitdown']
. 它应包含
['idb', 'websql', 'fruitdown']
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.