-
Notifications
You must be signed in to change notification settings - Fork 97
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
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading my site key) #182
Comments
Same issue |
I have the same issue |
Same here. Hook is used only on one page, so it's not used app-wide. It's happening on navigation / changing route (respectively, when page with recaptcha is loaded, then navigated away to other page and then navigated back to the page with recaptcha) . I'm using Next.js. |
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'auto_render_clients') I am getting this error too and my code is almost similar to the code above |
same for me too it wasn't like that last week but certainly when I navigate between routes it throws error like this not on first load |
I used the version 1.9.7 instead and the problem got solved |
@t49tran 🥺❓ |
Maybe that problem is underlaying in "not-reusing previously generated token" (and trying to generate a new one again, on re-mount)? So, try to save firstly generated token ... and on component re-mount ... do not call executeRecaptcha ... and try to re-use the firstly generated token ... It's just guess. (by the way, I'm currently "solving" (workarounding, respectively :D) above TypeError by placing executeRecaptcha into try/catch statement.) Hope this helps at least temporairly to someone. If i can elaborate more on this, I think that documentation uses Recaptcha's Context/Provider in App-wide manner ... but we, who got into the problems are probably using it just on per-page basis, so, re-mounting causing troubles. Please, can anybody put some light into this? |
same here 😞 |
is there any update for this issue? I'm facing same issue! |
Same for me... |
I am facing the same issue. Do we have solution for this? |
I'm not sure if it can help someone, but I simply don't use React libraries to implement reCAPTCHA v3 anymore. I import reCAPTCHA v3 via CDN in index.html:
For those using TypeScript, I install the Then, I use it as follows:
|
Hope this helps. const scriptSelector = 'script[src=\'https://www.google.com/recaptcha/api.js?render=' + recaptchaSiteKey + '\']';
const script = document.querySelector(scriptSelector);
if (script) {
script.remove();
} P.S. It appears that this code is already present in this package.. :-( |
Still an issue... |
Along with "sitekey" error getting one more error 🥹
|
Getting the same error as well. Any update? Edit: |
@Hamin-Jeon Hello, Try wrapping the GoogleReCaptchaProvider component in the parentmost app.jsx or app.tsx component. like this in App.tsx
I was getting also the same issue but after this config. it is resolved. |
This also worked for me. |
Still a valid issue. |
Great workaround! |
Same issue to me, code as similar. Version 1.10.1 |
Thank you this fixed it for me. Using React 18.2.0 |
This is was the correct solution for us. Downgrading to 1.9.8 did not solve our problem. We were still unable to submit our forms twice. This library was a good effort but it seems to no longer be maintained and it is not working correctly for us anymore. |
I want to use 'recaptcha' only for Join Component.
If you attempt to mount the Join Component again after the component is unmounted, an error occurs.
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading my site key)
my code
The text was updated successfully, but these errors were encountered: