Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading captcha with angular 6 #5881

Closed
aceleghin opened this issue Jun 11, 2018 · 7 comments
Closed

Error loading captcha with angular 6 #5881

aceleghin opened this issue Jun 11, 2018 · 7 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@aceleghin
Copy link

[ X ] bug report => Search github for a similar issue or PR before submitting

I am using primeng captcha with angular 6 and when I try to directly load the page that has captcha confirmation I have this error:

ERROR TypeError: window.grecaptcha.render is not a function at Captcha.push../node_modules/primeng/components/captcha/captcha.js.Captcha.init (captcha.js:42) at Captcha.push../node_modules/primeng/components/captcha/captcha.js.Captcha.ngAfterViewInit (captcha.js:32)

I have only initialized the captcha in my index.html:
<script src="https://www.google.com/recaptcha/api.js?render=explicit" async defer></script>

But it works if I route to this page from another page.

  • Angular version: 6
@aceleghin
Copy link
Author

@cagataycivici please it's urgent, you have the same error in your documentation:
primeng captcha

@LoicDelorme
Copy link

@cagataycivici same issue for me... If you refresh the page, the component doesn't work anymore. Could you please fix that behavior?

@kisscool62
Copy link

@LoicDelorme same issue here

@zenoxs
Copy link

zenoxs commented Jun 20, 2018

It annoys me, i have to use an other dependencies to make reCapatcha work.
Thanks you for taking a look at this issue 🙏

@aceleghin
Copy link
Author

No one is listening to us...

@drenda
Copy link

drenda commented Oct 4, 2018

Same issue here. Do you have some updates about the issue? Thanks

@JacobSiegle
Copy link
Contributor

I run into the same issue and use a timeout to delay the PrimeNG component from loading which fixes it for my users (gives time for the captcha script to load).
setTimeout(() => { this.showCaptcha = true; }, 200)

Comment tag to look further into if I get time. PrimeNG component needs a hook to only attempt the captcha calls when the script is available.

@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working Status: Pending Review Issue or pull request is being reviewed by Core Team labels Jan 11, 2019
@cagataycivici cagataycivici added this to the 7.0.5 milestone Jan 11, 2019
cagataycivici added a commit that referenced this issue Jan 23, 2019
fixed #5881 Error loading captcha with angular 6
@cagataycivici cagataycivici removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

8 participants