Closed floppydisken closed 1 year ago
The same, any solution?
The problem comes from customElements.whenDefined
and probably the solution is here
https://github.com/webcomponents/polyfills/pull/447
The problem comes from
customElements.whenDefined
and probably the solution is here webcomponents/polyfills#447
I didn't find a solution. Did you test the polyfill?
I tested two things:
cusomElements.whenDefined("stripe-payment-sheet")
in the browser to test if it resolves if the custom element is already defined. This worked fine.With no luck.
I experienced the same problem and it is bug of this plugin. See this line: https://github.com/capacitor-community/stripe/blob/master/src/react/provider.tsx#L31
It creates a Promise, but never resolves, when web platform is detected.
if you change this
new Promise<void>(resolve => Capacitor.isNativePlatform() ? resolve() : defineCustomElements()).then(() => {...
to this:
let prom = Capacitor.isNativePlatform() ? Promise.resolve() : defineCustomElements()
prom.then(() => { ....
it starts working again.
Platform
Describe the bug After upgrading to v4.0.0+ the CapacitorStripeProvider gets stuck in fallback mode.
To Reproduce Steps to reproduce the behavior:
npm run start
Expected behavior To properly initialize the provider for the web project.