-
Notifications
You must be signed in to change notification settings - Fork 129
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
Getting error when recaptcha is not rendered #68
Comments
I'm not sure exactly why this might be, but have you tried using |
I'm planning on using hidden for the time being, but the issue is on other pages where there is no form (and thus no recaptcha) I'm still getting this error. Which now makes me think I'm doing something wrong.
|
So I realized I can't use I'm not really all that experienced, but if the component isn't yet in the view (thanks to something like |
Thank you for submitting this, @rohitsodhia , and for doing initial triaging! I've tried to reproduce this error in plunker (see here), but my attempt was unsuccessful. Could it be that there is something else in your scenario, that is different from this example? |
Looking at that plunker vs what I have, I see it's because I have code separated into modules. I noticed that in the readme, there is a link saying more information on modules later, though it doesn't go anywhere. I created a quick repo reproducing the error in a clean environment. I'm hoping that it's just a case of me not using your project correctly or perhaps something about Angular I don't yet understand. Admittedly, I tried to download and debug the package myself to get into the open source community, but alas, tis not so. |
@rohitsodhia sorry for not responding for a while. Were you able to resolve this issue? |
No problem. And no, I wasn't. After making the repo I linked above, I ended up working on a different feature and haven't been back to this since. |
I'm also seeing this error where I'm using component factory to create a component(works ok) then if I destroy that component, and make it again later(probably being reused?) I get the Update: Most Likely unrelated my bug, and my own doing. It looks in my component factory, angular is creating the component before putting anything in the DOM, and since the element isn't in the document, well, I get the error that it isn't there. |
After poking around for a bit, without brute forcing it(try catch then break when we actually render), not sure if there is a good way out in my scenario. Angular(4) appears to be rendering my DOM internally, and then appending it to the real DOM, which will never work. And I'm assuming you are stuck in a similar issue, where, with the subcomponent that way the modal renders the stuff and then hides it, then triggers the afterViewInit. |
@rohitsodhia @brgaulin looks like this issue will be solved by #77 (tested in locally and with the example provided by @rohitsodhia ). |
Looks good. To follow up. My bug was how I was rendering the captcha. I was creating the component with a factory. Then adding it to a view. When I inverted this so that the parent component created it. It was much happier. This commit also looks great! Thanks for the follow up!! |
I have a recaptcha in a div that's hidden until I need the form. I'm using a
*ngIf
to show or not show the form. When the default state is shown, no problem. When the default state is hidden, instead, I get:Admittedly, I'm not great at debugging JS, but I tried searching online for what may be an issue, and couldn't find anything. I'm hoping you may be able to help me figure out where I may have gone wrong? Given nothing's rendered yet, I'm confused why it'd be trying to place one?
The text was updated successfully, but these errors were encountered: