Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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. #2108

Open
bbhxwl opened this issue Dec 16, 2024 · 1 comment

Comments

@bbhxwl
Copy link

bbhxwl commented Dec 16, 2024

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
@dfahlander
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants