react-stripe-elements icon indicating copy to clipboard operation
react-stripe-elements copied to clipboard

CardElement intermittently doesn't appear on Safari

Open GabeIsman opened this issue 9 years ago • 20 comments

I've had multiple reports (with screenshots) from users of CardElement not rendering (just never appears) on Safari (one of them Version 10.1.1 (11603.2.5)). There were no errors in the console. The problem did not persist after a refresh, and I was not able to reproduce it.

I know this is not a terribly helpful bug report, but I thought you should know that I have seen this happen.

GabeIsman avatar Jul 13 '17 15:07 GabeIsman

@GabeIsman thanks for the report -- is there a particular integration or webpage that you've seen this on?

michelle avatar Jul 13 '17 15:07 michelle

Observed here: https://www.themarshallproject.org/support-us.

GabeIsman avatar Jul 13 '17 16:07 GabeIsman

@GabeIsman Thanks! I'll take a look now.

michelle avatar Jul 13 '17 16:07 michelle

Interesting -- I could only reproduce this no the first page load. Perhaps it has something to do with a cold cache.

michelle avatar Jul 13 '17 17:07 michelle

I can now no longer reproduce this at all, even after disabling / clearing caches :(. I'll try again on a different machine tomorrow.

michelle avatar Jul 14 '17 01:07 michelle

Thanks for looking into this @michelle. It was quite puzzling to me as well.

GabeIsman avatar Jul 14 '17 16:07 GabeIsman

Hi @GabeIsman have you had any further reports of this? Just poking around and I can't seem to make this happen (tried a couple different things).

fred-stripe avatar Jul 25 '17 15:07 fred-stripe

@fred-stripe I haven't had any further reports, but I don't think that I would have. (We have a low volume of Safari users.) I wish I had better guidance for you on how to reproduce. It seems to only happen once, if it does at all.

GabeIsman avatar Jul 25 '17 17:07 GabeIsman

Hi @fred-stripe we have just moved over to the new elements library and are having a similar issue. We are getting the following error being reported sporadically to Sentry:

Please load Stripe.js (https://js.stripe.com/v3/) on this page to use react-stripe-elements.

this is despite the fact that the script tag is at the top of the page before the react app is loaded.

It is only happening on mobile safari on iOS 10.3.3 and 11.0.3. I have been unable to recreate this myself, which I realise is unhelpful, but I have the sentry errors if that is useful.

Barnyclark avatar Nov 03 '17 13:11 Barnyclark

@Barnyclark are you still facing that issue? If not, since we're unable to reproduce this issue, we might go ahead and close it.

atty-stripe avatar Feb 07 '18 21:02 atty-stripe

Ho @atty-stripe we are still having this issue, it is not restricted to safari though, we receive the error on a small number of requests across all browsers/devices.

Barnyclark avatar Feb 09 '18 16:02 Barnyclark

Hmm that's strange -- could you share the Sentry issues please?

atty-stripe avatar Feb 09 '18 20:02 atty-stripe

Here is an example: https://sentry.io/share/issue/30833e57245a420987aefd880febc927/

Barnyclark avatar Feb 16 '18 18:02 Barnyclark

Thanks @Barnyclark!

Unfortunately there's little we can deduce from the Sentry issue, since it simply says that Stripe.js didn't load. Are you sure this wasn't a network issue or something else that actually prevented the script from loading? It might be useful to check if window.Stripe exists and report that in your logs, so the next time this error pops up you can be sure if this was simply a network issue that prevented the script from loading.

Otherwise we haven't been able to repro this. If you have any more info you can share, would love to see it!

atty-stripe avatar Feb 18 '18 03:02 atty-stripe

I would like to add that I am also seeing this error:

Error: Please load Stripe.js (https://js.stripe.com/v3/) on this page to use react-stripe-elements.

intermittently across all browsers, but seemingly always on mobile. It makes sense that it would be network issues. Maybe the network became weak during loading of the app, and could not successfully load Stripe.js. It doesn't happen all that often.

titomb345 avatar Feb 18 '18 21:02 titomb345

Over the past 10ish days we have the same problem with 4 different customers -- all fo them were trying to open the payment page on Safari on their iphone. Granted no idea what the iOS/Safari version is though. I agree that it probably is an intermitent network delay on their mobile but would be nice if their was a "way to test" for it even if just to give a message to the user - "please refresh, an error occurred while setting up the payment page"

jab1000 avatar Sep 05 '18 20:09 jab1000

It appears that this error is always triggered by Stripe.js failing to load over the network or loading in the wrong order. I am inclined to close this issue, since we understand what is causing it, and to use issue #237 as a place to discuss providing some API surface area for applications to be able to catch this error and respond to it in some useful way.

asolove-stripe avatar Sep 12 '18 02:09 asolove-stripe

I ran into today as well. This seems to happen now consistently on Opera too. A couple of weeks ago there were no problems and the codebase hasn't been updated since. There are a couple of network requests to js.stripe.com that will never finish.

Edit: here's a jsfiddle where the problem occurs with Opera 63.0.3368.107: https://jsfiddle.net/0yeo7t21/

Edit 2: I updated Opera to version 64.0.3417.61 and now the components are working again.

Screenshot 2019-10-21 at 13 19 17

tuomashatakka avatar Oct 21 '19 11:10 tuomashatakka

This has also been occurring in our app that is a NextJS app. It only occurs in Safari and Safari on iOS. It only happens when the user uses the "refresh" button in Safari. If you click in the address bar and click the enter key, it works fine. I notice in the inspector that certain Stripe assets just do not load.

image

I originally thought it might be an SSR issue, but I ruled that out by testing a statically deployed site.

Could it be something related to how NextJS is bundling the assets or something to do with how Safari caches certain assets? I am at a loss. I appreciate any suggestions.

kevinswarner avatar Apr 10 '20 18:04 kevinswarner

I’m having the same issue as @kevinswarner.

esetnik avatar Apr 26 '20 16:04 esetnik