Open gremo opened 2 years ago
+1
Replicated the issue:
forward: ["mozRequestAnimationFrame"]
doesn't seem to work for me either.
UPDATE:
I tweaked a local copy of Partytown to include all global functions Recaptcha required, inside of worker-window.ts:392
:
win.mozRequestAnimationFrame = win.webkitRequestAnimationFrame = win.webkitAnimationFrame = win.msRequestAnimationFrame = win.requestAnimationFrame = (cb: (ts: number) => void) =>
setTimeout(() => cb(performance.now()), 9);
win.webkitCancelRequestAnimationFrame = win.webkitCancelAnimationFrame = win.cancelAnimationFrame = (id: number) => clearTimeout(id);
But then I get this error from Recaptcha:
TypeError: Failed to execute 'postMessage' on 'MessagePort': Overload resolution failed.
This looks similar to issue #208 where spawning workers within workers is not allowed. Can someone please provide more details about why workers within workers are not allowed?
Is there any update or workaround about this?
This is my first time with partytown. I'm try to load Recaptcha v3 script into the worker thread.
This is the partytown configuration in the
<head>
:And I'm loading Recaptcha v3 at the
<body>
bottom (site key XXX):The Recaptcha script seems to load fine (no CORS errors)... but as soon as it loads, I get the error:
Adding
forward: ["mozRequestAnimationFrame"
] doesn't help at all.