Dexie.js icon indicating copy to clipboard operation
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.

Open bbhxwl opened this issue 1 year ago • 1 comments

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'>;
};
image

bbhxwl avatar Dec 16 '24 14:12 bbhxwl

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().

dfahlander avatar Dec 16 '24 16:12 dfahlander