logIn() gets stuck when using dev wallet on our page
Closed this issue · 1 comments
We've been using blocto and testnet for local development, but I've been trying to get us set up with the dev wallet. I have the wallet running successfully and everything configured properly, however on login()
/authenticate()
an empty iframe is created and it doesn't prompt for auth.
I dug pretty deep, and found that the empty iframe exists because theWalletUtils.ready(callback)
event never makes it to fcl. The reason why that happens is because of fcl uses window.parent to send the message.
I logged window.parent from within the dev wallet iframe in the test harness and in my code.
In the test harness, I see that window.parent is a complete object (this is just part of it):
However, in my app, it looks like window.parent[0]
has the full object, but window.parent itself is missing nearly all properties. Here's the whole object:
This causes fcl to use postMessage from the nearly empty parent, which apparently does nothing. This only happens in my app when using the dev wallet. It doesn't happen when using blocto, and it doesn't happen in the test harness. I'm using the same browser (Chrome) in all these cases.
I'm pretty new to front-end development and to flow, so I'm not sure what's wrong here. Is something broken in my app? Is the dev wallet setting the parent incorrectly? Is fcl accessing the parent incorrectly?
Any pointers on how to work around this or how to debug further would be much appreciated.
Turns out this was because my app was using an older version of @onflow/fcl. Upgrading to ^0.0.78-alpha.4 fixed it for me.