basaran / svelte-recaptcha-v2

Google reCAPTCHA v2 implementation for Svelte SPA, SSR and sveltekit static sites.
https://basaran.github.io/svelte-recaptcha-v2/demo
MIT License
42 stars 14 forks source link

Uncaught Error: reCAPTCHA placeholder element must be an element or id #4

Closed CNeenan closed 4 months ago

CNeenan commented 2 years ago

Seeing the above error when trying to add:

<Recaptcha sitekey={recaptchatoken}
             badge={"inline"}
             size={"normal"}
             on:success={onCaptchaSuccess}
             on:error={onCaptchaError}
             on:expired={onCaptchaExpire}
             on:close={onCaptchaClose}
             on:ready={onCaptchaReady} />

Does this need to sit inside of some placeholder div? If so what id/class is required?

basaran commented 2 years ago

No, it should be fine on its own, it will create the div for you. Just make sure your token is fine.