【发布时间】:2017-04-06 12:21:11
【问题描述】:
这是我已经研究了一段时间的代码。出于某种原因,它返回给我以下错误:
Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.
这甚至在我尝试使用 upsert 插件之前就已经发生了。
db.get(id).then(doc => {
console.log(doc);
return db.upsert(id, doc => {
doc.exp_date = moment(doc.exp_date).add(parseInt(document.getElementById('ext_date').value), 'years');
return doc;
}).then(res => console.log(res)).catch(err => console.log(err));
})
我可以知道这个错误的解决方法吗?
【问题讨论】:
标签: javascript indexeddb pouchdb