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

reCAPTCHA couldn't find user-provided function: onloadCallback

Open ochanje210 opened this issue 6 years ago • 10 comments

I have followed Explicitly render the reCAPTCHA widget and having the following message:

reCAPTCHA couldn't find user-provided function: onloadCallback

ochanje210 avatar Jun 05 '18 12:06 ochanje210

I've had the same issue and found two solutions:

  1. Add the onloadCallback function to window
  2. Remove the onload=onloadCallback part from the query string of the script you included in index.html

razvansandu avatar Jun 06 '18 11:06 razvansandu

I had the same problem started from these few days. It solved by @razvansandu comments. thanks.

JaosnHsieh avatar Jun 07 '18 02:06 JaosnHsieh

Maybe try making it more modern and react-way and use my new React reCAPTCHA wrapper library. I think you'll feel much better with it 😄 🚀

Library: https://github.com/sarneeh/reaptcha Example: https://sarneeh.github.io/reaptcha/

jsardev avatar Jun 13 '18 20:06 jsardev

Hello razvansandu I have a question I have an issue like ochanje210. Could you explain your solution 1 in more detail? what is window? How do i have to add onloadCallback? please tell me about it in detail Thanks

ghost avatar Oct 27 '18 16:10 ghost

I've found a solution: just pass onloadCallback to the component, even if it is sometime not necessary to handle the onload event. version: 2.3.10

<Recaptcha sitekey="xxx" render="explicit" onloadCallback={() => console.log('loaded')} />

varpenny avatar May 14 '19 07:05 varpenny

In your index.html you probably have this:

remove "onload=onLoadCallback"

should look like this:

That worked for me

mwang7 avatar Jul 19 '19 15:07 mwang7

a

EitsamShahzad avatar Jan 23 '20 12:01 EitsamShahzad

Tuve el mismo problema y removiendo "onload=onLoadCallback" del Query me funciono, como lo mencionan arriba. Mi query quedo :)

JozeHernandez avatar Oct 20 '20 21:10 JozeHernandez

In your index.html you probably have this:

remove "onload=onLoadCallback"

should look like this:

That worked for me

I had this loading in as <script src="https://www.google.com/recaptcha/api.js" async defer></script> and adding ?&render=explicit to the src worked for me. Thanks for this, I've been looking for a solution (using jQuery) for ages.

DanCanetti avatar Jan 08 '21 12:01 DanCanetti

brother just replace your script with this :100:

waliddeejay avatar May 16 '21 04:05 waliddeejay