-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
Description
Sometimes information is posted "cross-context" that can't be posted.
An easy check for what can be posted is using structuredClone.
Good examples:
structuredClone([1, 2, 3]);
structuredClone(new Uint32Array([1, 2, 3]))Bad examples:
structuredClone(() => {});
structuredClone(class {});So we just get this error: Uncaught DataCloneError: Failed to execute 'structuredClone' on 'Window': class {} could not be cloned.
Errors:
So this usually happens when a type is typeof SomeClass... because then the value is of course the class, which can't be cloned.

