ReCaptcha V3 Invisible: Uncaught (in promise) Request timed out

Viewed 1957

The following bit of JavaScript is giving me errors about 50% of the time.

grecaptcha.ready(() => {
    grecaptcha.execute('XXXXXXXX_XXXXXXXX_XXXXXXX', {action: 'XXXXXXXX'}).then(token => {
        this.rootNode.insertAdjacentHTML('afterbegin', '<input type="hidden" name="g-recaptcha-response" value="' + token + '">');
        this.onRecaptchaKeyAdded(token);
    });
});

It's being called on pageload, and then submitted later with the form. This error is occurring a little while after the page loads (suggesting what the error says, the request timed out).

Recaptcha Error

Tried a lot of different solutions. No .catch method is available on the promise returned from google, so there's no way to catch the error and simply retry.

0 Answers
Related