ng-recaptcha
ng-recaptcha copied to clipboard
Error: reCAPTCHA client has been deleted: 0
Summary
I'm submitting a:
- [x] bug report
- [ ] feature request
- [ ] question / support request
- [ ] other
Description
I use the forms module and use the recaptcha component as follows:
<re-captcha formControlName="captcha"></re-captcha>
After my form is successfully submitted, I remove it from the DOM using an *ngIf
to show a "Thank you" message and a "Start over" button. When I click on the Start over
button, the form reappears as I set the ngIf
condition to true and reset my form using form.reset()
. When this happens, I get the following error:

Workaround
In my template:
<re-captcha (resolved)="recaptchaResolved($event)"></re-captcha>
In my component:
recaptchaResolved(response: string) {
this.form.get('captcha').setValue(response);
}
Lib versions:
- ng-recaptcha: 4.2.1
- Angular: 7.2.0
- Typescript (
tsc --version
): 3.2.2
I have the same issue with react
Same issue here that started happening today for some reason. The issue happens when I navigate away from the page and the component including the captcha gets reset in the ngOnDestroy. Not sure why it has started happening only today.
Same issue here, that started at around 3pm EST. Affected a major Fortune Company's System that utilized ReCaptcha in Production. Had to design workaround to get functioning again by bypassing this error.
Same here - work around for me was to update the component which renders ReactGoogleRecaptcha
to dispose of the instance before it unmounts.
// hack fix here to make sure reCaptcha resets before component unmounts
this.reCaptchaInstance.reset();
// and then we must unset our widgetId or else ReCAPTCHA.prototype.reset will crash
this.reCaptchaInstance._widgetId = undefined;
}
We are hitting this as well. Any ideas on what changed to cause this issue? Did google make an update?
Edit: This resolved itself on our side without any changes.
Google did make an update. They did revert the change. We are back up and running now.
From: Bennett Miller [email protected] Sent: Thursday, April 18, 2019 9:55:10 PM To: DethAriel/ng-recaptcha Cc: CIAMoptimist29; Comment Subject: Re: [DethAriel/ng-recaptcha] Error: reCAPTCHA client has been deleted: 0 (#136)
We are hitting this as well. Any ideas on what changed to cause this issue? Did google make an update?
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/DethAriel/ng-recaptcha/issues/136#issuecomment-484751816, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AL3XNUR6YI7PIKJOKQUXCWTPREYA5ANCNFSM4GT7KI2Q.
Do you happen to have a source on that - was there a post about it?
We have a contact within Google Engineering, but we will be following up with them to see if there is a public bulletin that will be posted about it. If they do release it, I will be sure to provide it back here. I know this affected many people from their email.
Ran into this using a React implementation the same day across multiple projects. Confirmed that it's resolved itself, but very strange that I can't find a changelog anywhere to verify that a change on their side caused the issue. 🤷♂️
@CIAMoptimist29 was there a bulletin by any chance?
+1
+1
+1
this.reCaptchaInstance.reset();