ng-recaptcha icon indicating copy to clipboard operation
ng-recaptcha copied to clipboard

Error: reCAPTCHA client has been deleted: 0

Open gempain opened this issue 5 years ago • 14 comments

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:

screen shot 2019-02-02 at 23 42 18

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

gempain avatar Feb 02 '19 22:02 gempain

I have the same issue with react

Bigdeeua avatar Apr 18 '19 23:04 Bigdeeua

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.

hgrubst avatar Apr 19 '19 00:04 hgrubst

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.

CIAMoptimist29 avatar Apr 19 '19 02:04 CIAMoptimist29

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;
  }

miex0r avatar Apr 19 '19 02:04 miex0r

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.

millerbennett avatar Apr 19 '19 02:04 millerbennett

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.

CIAMoptimist29 avatar Apr 19 '19 03:04 CIAMoptimist29

Do you happen to have a source on that - was there a post about it?

millerbennett avatar Apr 19 '19 03:04 millerbennett

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.

CIAMoptimist29 avatar Apr 19 '19 12:04 CIAMoptimist29

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. 🤷‍♂️

robframpton avatar Apr 22 '19 17:04 robframpton

@CIAMoptimist29 was there a bulletin by any chance?

DethAriel avatar Jun 04 '19 23:06 DethAriel

+1

ivanff avatar Nov 08 '19 13:11 ivanff

+1

duymon178 avatar Apr 23 '20 03:04 duymon178

+1

willvlad avatar Mar 09 '21 14:03 willvlad

this.reCaptchaInstance.reset();

MohamedMahsoon97 avatar Dec 01 '22 00:12 MohamedMahsoon97