DethAriel / ng-recaptcha

Angular component for Google reCAPTCHA
https://dethariel.github.io/ng-recaptcha/
MIT License
475 stars 128 forks source link

Error: reCAPTCHA client has been deleted: 0 #136

Open gempain opened 5 years ago

gempain commented 5 years ago

Summary

I'm submitting a:

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:

Bigdeeua commented 5 years ago

I have the same issue with react

hgrubst commented 5 years ago

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.

CIAMoptimist29 commented 5 years ago

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.

miex0r commented 5 years ago

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;
  }
millerbennett commented 5 years ago

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.

CIAMoptimist29 commented 5 years ago

Google did make an update. They did revert the change. We are back up and running now.


From: Bennett Miller notifications@github.com 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.

millerbennett commented 5 years ago

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

CIAMoptimist29 commented 5 years ago

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.

robframpton commented 5 years ago

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

DethAriel commented 5 years ago

@CIAMoptimist29 was there a bulletin by any chance?

ivanff commented 5 years ago

+1

duymon178 commented 4 years ago

+1

willvlad commented 3 years ago

+1

MohamedMahsoon97 commented 1 year ago

this.reCaptchaInstance.reset();