Dexie.js
Dexie.js copied to clipboard
Failed to execute 'add' on 'IDBObjectStore': [object Array] could not be cloned. DataCloneError: Failed to execute 'add' on 'IDBObjectStore': [object Array] could not be cloned.
How can I customize columns?
Failed to execute 'add' on 'IDBObjectStore': [object Array] could not be cloned. DataCloneError: Failed to execute 'add' on 'IDBObjectStore': [object Array] could not be cloned.
interface dbHbServiceOrderDetailsApprovalLog {
id: number;
userId: bigint;
logAddTime: string;
[key: string]:any
}
const db = new Dexie('adl') as Dexie & {
dbHbServiceOrderDetailsApprovalLog: EntityTable<dbHbServiceOrderDetailsApprovalLog, 'id'>;
};
Make sure that the objects you add does not contain promises or functions. Set a breakpoint on the line that adds an object and inspect the object. Or if you prefer to console.log item before sending it along to table.add().