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

Can't use chrome debugger #20

Open
DZuz14 opened this issue Jan 7, 2021 · 5 comments
Open

Can't use chrome debugger #20

DZuz14 opened this issue Jan 7, 2021 · 5 comments

Comments

@DZuz14
Copy link

DZuz14 commented Jan 7, 2021

I am getting an Invariant Violation any time I attempt to use the Debugger in React Native. This only occurred after I installed your package.

I looked in your source code and found some methods in the Java package that are synchronous.

After checking the lib/index.tsx file I saw that the StripePayments.init method gets invoked automatically when you use the setOptions method. I found that if I comment out the StripePayments.init line in the compiled JS code, my debugger then starts working properly.

Any advice? Thank you for the library.

Screenshot_1610056399

@DZuz14
Copy link
Author

DZuz14 commented Jan 8, 2021

@viktorasl
Copy link
Member

viktorasl commented Feb 21, 2021

Hm, I should look deeper. I'm not quite familiar with react native architecture in such details.

EDIT:
I see that there are two synchronous method. First one which you referenced initializes (sets up) Stripe SDK and as it could be called right before i.e payment I prefer it to be sync.

The second one is credit card validation. Will it cause problems for chrome debugger as well?

@DZuz14
Copy link
Author

DZuz14 commented Feb 23, 2021

@viktorasl I'm surprised other people haven't had a problem with this. What do you think about providing an async version of the setup method that returns a promise (I know it sounds kind of weird, but inherently everything that executes in the JS bridge is async, so it wouldn't be that weird)? In regards to the card validation, we don't use that part of the library, so it won't break the debugger, because we don't call that method.

@viktorasl
Copy link
Member

The idea to have an async method looks valid. I'll look deeper into best practices communicating via the JS-Native bridge and maybe even make card validation async as well

@DZuz14
Copy link
Author

DZuz14 commented Feb 26, 2021

Cool. Sounds great! =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants