Dexie.DataCloneError
Inheritance Hierarchy
Dexie.DexieError
Dexie.DataCloneError
Description
An attempt to add or put an item into the database was made, where the object contained a strucure not supported by the Structured Cloning algorithm, such as a Function or Error object.
What does this mean?
It means you tried to store an object that contained properties of unsupported (not cloneable) types. The supported types are defined in the DOM standard structured cloning.
Examples of supported types: string, number, Blob, typed arrays, Map, Set, CryptoKey, arrays, booleans, null etc. Examples of unsupported types: function, symbol, WebSocket, WeakMap, window, document, etc ...
To fix this, you first need to debug your code and look at the data you are trying to put into IndexedDB. Does it contain the data you intend it to contain? Or do you have an application bug that makes it try to store a function or something else that isn't cloneable?
Sample using Promise.catch()
Sample: switch(error.name)
Properties
message
Detailed message
inner?
Inner exception instance (if any)
stack
Can be present if the error was thrown. If signaled, there wont be any call stack.