An error we need help with that we keep seeing in our logs.
We use sentry.io logging to capture JavaScript errors and we have been having some issues where our users can not see out payment form.
We have not been able to reproduce this our self.
Could you explain what this error means and if we can do anything to resolve this.
To clarify this error does not happen to all of our members.
The error message:
BraintreeError: Hosted Fields timed out when attempting to set up.
Thanks for all the help.
This error occurs when the Hosted Fields iframes take longer than 60 seconds to load. This error was added in 3.27.0. Previously, the callback would just never got called.
This _could_ happen if the customer has an extremely slow internet connection, or has some browser extension that blocks the iframes from loading.
Does it consistently occur for your customers that are reporting it? Or is it intermittent for them as well?
We get about 10 every day and this may be normal. Some of our members are okay waiting for 60 sec or longer due to slow internet speeds. If there is something we can do to extend it to 120 seconds that would work. if it takes longer the member will probably leave so that is fine. If it due to and error and we can retry that may be good as well. We also see this one "BraintreeError: Cannot contact the gateway at this time" quite frequently. We are just trying to eliminate members from not signing up.
@pietersharefaith Can you contact our support team so we can get better visibility into your integration? https://articles.braintreepayments.com/forms/contact
We are experiencing this also for some of our users.
No chrome plugins and stable internet connection.
Currently on "braintree-web": "^3.31.0"
@mschinis Can you contact our support team so we can get better visibility into your integration? Would be great to get specific information about the customers that are affected so we can attempt to reproduce. https://articles.braintreepayments.com/forms/contact
We see this error intermittently in our testing environments with stable internet connections, and also in production. Right now the rate at which we are receiving this error is higher than 10%. I will contact support but I wanted to post here also.
version 3.33
@jeffbrabant did anything come out of your conversation with support? Is there anything more to share here?
I've looked through our ticketing system, and every ticket that was opened referencing this issue never responded to our support reps. If anyone can provide a consistent way to reproduce this, we're happy to look into it.
Going to close this for now, but feel free to comment here if you can provide a way for us to reproduce the issue.
Just found a ticket that looks like it might be able to reproduce the issue, re-opening this while I investigate it.
In this particular merchant's case, they were setting the fields object asynchronously. Hosted Fields checks whether or not a fields object exists, but it does not do any checking about the contents of that fields object.
So, if fields: {} is passed, Hosted Fields goes ahead and sets up no iframe inputs. Then it waits for the iframe inputs to message back that they are ready. But, since there are no iframes in the first place, it just waits for 60 seconds and then times out.
We're going to go ahead and add a check to make sure that the fields object is not empty. (we already have checks that the particular keys in the fields objects are valid, just missed one to check if there are any values at all)
3.36.0 adds a check for an empty fields object. Going to close this for now, but please comment here if y'all are still experiencing the timeout error after updating to 3.36.0
Still facing the issue. I made a issue and then found this. #395
@niteshgrg From your other issue, I see you're using Drop-in, we made some changes to Hosted Fields recently that should help with the timeouts you're seeing. I'm planning on releasing a new version of Drop-in this week that includes those changes. I'll update here when it is released.
@niteshgrg v1.14.0 of Drop-in is out. Please update to that version and try again.
If you still experience timeout issues after updating, feel free to comment on #395 or open a new issue, because I think whatever you are experiencing is separate from this issue.