Hello,
While using the JavaScript SDK we're often seeing the following error:
DataCloneError: Event object could not be cloned
After some investigation I was able to track down this behavior to a callback defined in the websocket worker onerror listener that tries to send an websocket error event.
WebSocket types cannot be cloned which results in the aforementioned error.
Verifying the minified genesys.min.js
file we can see the precise place where this behavior is being defined.
function n() {
e.command("GenesysVendors.WebSocket").then((function(n) {
var r = (t.data || {}).endPoint;
a && a.removeAllListeners(),
(a = new n(r)).open().then((function(n) {
a && (a.onMessage.addListener((function(t) {
e.publish("onWebSocketMessage", JSON.parse(t))
})), a.onClose.addListener((function(t) {
e.publish("onWebSocketClose", {
code: t.code,
reason: t.reason,
returnValue: t.returnValue,
timeStamp: t.timeStamp,
type: t.type,
wasClean: t.wasClean
})
})), a.onError.addListener((function(t) {
"object" === O(t) ? e.publish("onWebSocketError", t) : "string" == typeof t && e.publish("onWebSocketError", JSON.parse({
error: t
}))
})));
var r = Object(u.h)(n);
t.resolve(r)
})).catch((function(e) {
t.reject(e)
}))
})).catch((function(e) {
var n = e.error;
t.reject(n)
}))
}
Is this a known issue and is there a workaround for it? Thanks.