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

Missing event for doOpenAuth failure #186

Open
jjenzz opened this issue Jan 23, 2022 · 7 comments
Open

Missing event for doOpenAuth failure #186

jjenzz opened this issue Jan 23, 2022 · 7 comments
Labels

Comments

@jjenzz
Copy link

jjenzz commented Jan 23, 2022

I'm using react-connect but seems applicable to connect also.

When calling doOpenAuth in an incognito window, the auth window doesn't open and my app gets stuck in "loading" state.

It would be really helpful if there was a way to detect a failure so I can communicate that in the UI.

Video here: https://twitter.com/jjenzz/status/1485244796470009858?s=20

@fbwoolf
Copy link
Contributor

fbwoolf commented Jan 23, 2022

I agree, this would be helpful. Are you getting any feedback in the console as to why it is failing?

@jjenzz
Copy link
Author

jjenzz commented Jan 24, 2022

Looks like something to do with the connect-ui package:

image

I'm using https://remix.run which uses esbuild if that helps at all.

@He1DAr
Copy link

He1DAr commented Jan 25, 2022

This issue is caused by esbuild not supporting dynamic imports via plugins. When Connect fails to find a wallet (e.g. in incognito if wallet plugin is not enabled in incognito mode), it attempts to open the modal:
image
and fails due to esbuild lack of dynamic imports support.

@jjenzz
Copy link
Author

jjenzz commented Jan 25, 2022

Thanks for looking into that, I assumed something like that would be the case as I have had other issues with esbuild up to this point.

The ticket is about providing an onFailure event of some kind though because there is no way for my app to know something like this happened currently (e.g. connection drops and dynamic import fails).

@He1DAr
Copy link

He1DAr commented Jan 25, 2022

Thanks for looking into that, I assumed something like that would be the case as I have had other issues with esbuild up to this point.

The ticket is about providing an onFailure event of some kind though because there is no way for my app to know something like this happened currently (e.g. connection drops and dynamic import fails).

@jjenzz have you tried wrapping your component with error boundary?

@jjenzz
Copy link
Author

jjenzz commented Jan 25, 2022

I tried wrapping doOpenAuth() in a try {} catch(e) {} before which didn't catch it and have just tried an ErrorBoundary without success also.

@markmhendrickson
Copy link
Contributor

I'll review this issue with @sabbyanandan, @saralab and @janniks soon. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 📋 Backlog
Development

No branches or pull requests

7 participants