Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to execute 'postMessage' on 'DOMWindow' #31

Closed
ahkhanjani opened this issue Feb 6, 2024 · 5 comments
Closed

Error: Failed to execute 'postMessage' on 'DOMWindow' #31

ahkhanjani opened this issue Feb 6, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ahkhanjani
Copy link

Using useCallFrame, I get this error in the console:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://xxx.daily.co') does not match the recipient window's origin ('http://localhost:xxx').

Using an error boundary, the call frame doesn't render. But without it, everything works just fine. I'm not sure what the issue can be.

I'm wrapping my call with <DailyProvider> and passing the call frame object as callObject.

@ahkhanjani ahkhanjani added the bug Something isn't working label Feb 6, 2024
@Regaddi
Copy link
Contributor

Regaddi commented Feb 7, 2024

@ahkhanjani Are you able to provide the full call stack for this error? Ideally you can pinpoint the exact location of the postMessage that's causing this error using your browser's dev tools, this would be really helpful to narrow down the origin of the issue.

@ahkhanjani
Copy link
Author

ahkhanjani commented Feb 7, 2024

@Regaddi Here's the full call stack:

x x
value daily-esm.js:7
value daily-esm.js:7
value daily-esm.js:7
eval call.tsx:83
commitHookEffectListMount react-dom.development.js:23150
commitPassiveMountOnFiber react-dom.development.js:24926
commitPassiveMountEffects_complete react-dom.development.js:24891
commitPassiveMountEffects_begin react-dom.development.js:24878
commitPassiveMountEffects react-dom.development.js:24866
flushPassiveEffectsImpl react-dom.development.js:27039
flushPassiveEffects react-dom.development.js:26984
eval react-dom.development.js:26769
workLoop scheduler.development.js:266
flushWork scheduler.development.js:239
performWorkUntilDeadline scheduler.development.js:533

I believe everything after call.tsx is unrelated to the issue. call.tsx is the file that contains all of the Daily code. The specified line (83) is:

callFrame.once("loaded", () => setInitialConfigApplied(true));

I commented that line and now this line is specified:

callFrame.on("left-meeting", () => { ... });

This line that comes before them does not throw an error:

void callFrame.join({ ... });

So callFrame.once() and callFrame.on() trigger the error and callFrame.join() does not.

But by removing both .once() and .on() the call stack becomes:

x x
value daily-esm.js:7
value daily-esm.js:7
value daily-esm.js:7
eval daily-react.esm.js:2595
eval daily-react.esm.js:307
eval daily-react.esm.js:306
... [The same react-dom stuff]

It appears to be an internal problem.

@ahkhanjani
Copy link
Author

Hey @Regaddi,

Any updates on this? Since this is preventing me from using the new hook in production.
Both in localhost and the preview channel build we get the same error in the client console.

@Regaddi
Copy link
Contributor

Regaddi commented Feb 20, 2024

Hey @ahkhanjani,

I haven't been able to reproduce the issue myself.
For this specific issue it would be helpful to have a reliable reproduction case, ideally in a codesandbox or codepen, to further investigate the issue.

I think this is fairly related to daily-co/daily-js#241, but couldn't confirm, yet.

Thanks in advance and apologies for the delay here!

@ahkhanjani
Copy link
Author

Closing for now as it's probably some other library causing this. If the issue still remains after getting rid of the suspects I will let you know. Thanks again @Regaddi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants