Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/sour-bulldogs-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/clerk-js": patch
---

Improve the Smart CAPTCHA widget console error.
4 changes: 3 additions & 1 deletion packages/clerk-js/src/utils/captcha/hcaptcha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export const getHCaptchaToken = async (captchaOptions: {
visibleDiv.style.display = 'block';
widgetDiv = visibleDiv;
} else {
console.error('Captcha DOM element not found. Using invisible captcha widget.');
console.error(
'Cannot initialize Smart CAPTCHA widget because the `clerk-captcha` DOM element was not found; falling back to Invisible CAPTCHA widget. If you are using a custom flow, visit https://clerk.com/docs/custom-flows/bot-sign-up-protection for instructions',
);
widgetDiv = createInvisibleDOMElement();
isInvisibleWidget = true;
hCaptchaSiteKey = invisibleSiteKey;
Expand Down
4 changes: 3 additions & 1 deletion packages/clerk-js/src/utils/captcha/turnstile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ export const getTunstileToken = async (captchaOptions: {
visibleDiv.style.display = 'block';
widgetDiv = visibleDiv;
} else {
console.error('Captcha DOM element not found. Using invisible captcha widget.');
console.error(
'Cannot initialize Smart CAPTCHA widget because the `clerk-captcha` DOM element was not found; falling back to Invisible CAPTCHA widget. If you are using a custom flow, visit https://clerk.com/docs/custom-flows/bot-sign-up-protection for instructions',
);
widgetDiv = createInvisibleDOMElement();
isInvisibleWidget = true;
turnstileSiteKey = invisibleSiteKey;
Expand Down