This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Make ErrorConstructor more robust for DataCloneError (v1.7.4) #16707
Open
Description
Seeing lots of those errors in my app:
Uncaught DataCloneError: Failed to execute 'postMessage' on 'Window': function (){var paramPrefix,i,code=arguments[0],template=arguments[1],message=\"[\"+(module?module+\":\":\"\")+code+\"...<omitted>...)} could not be cloned.
caused from user agent facebookexternalhit. After some examinations it turns out to happen inside the ErrorConstructor of v1.7.4 itself.
I think the constructor itself should be more stable when an error inside occurs, probably with a try-catch block. My guess is the toDebugString()
fn which calls the serializeObject()
fn where this happens, where a cloning attempt is made and fails.
There I would make the code more robust.