Troubleshoot reCAPTCHA integration issues

This document lists common reCAPTCHA integration issues that developers might encounter when using reCAPTCHA in their environment.

Invalid site key

If you see the Invalid site key error, your reCAPTCHA site key is no longer valid. Create a new key and install it on your web pages.

Keys migration failure

Site keys can fail to migrate in one of the following scenarios:

  • You've exceeded the number of projects that you or your organization can create.

    To resolve this, you can reuse an existing project, request an increase in project creation quota, or wait for the automated migration to complete.

  • Your workspace organization has restricted creating of new Google Cloud projects.

    To turn on the Google Cloud service in the Google Admin console, contact your administrator. For more information, see Turn Google Cloud on or off for users.

SecurityError: blocked a frame with origin "https://www.google.com" from accessing a frame with origin "&ltyour domain&gt"

This typically occurs if the reCAPTCHA widget HTML element is programmatically removed sometime after the end user clicks on the checkbox. We recommend using the grecaptcha.enterprise.reset() JavaScript function to reset the reCAPTCHA widget.

Localhost is not in the list of supported domains

Localhost domains are not supported by default. If you want to continue supporting them for development, you can add them to the list of supported domains for your site key. Go to the Google Cloud console to update your list of supported domains. We advise to use separate keys for development and production, and to only allow localhost on your development site key.

reCAPTCHA returned BROWSER_ERROR when creating an assessment

BROWSER_ERROR tokens occur when the reCAPTCHA script cannot perform an execute operation. In most cases, this is due to a client-side network failure or timeout. You must retry execute() using the JavaScript.