You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I include GoogleReCaptchaProvider globally, everything works fine.
However, since reCAPTCHA is only needed on the contact page, I decided to limit its scope to just that page.
This approach helps to reduce unused JavaScript and improve the Google Chrome Lighthouse score for the other pages.
So I moved GoogleReCaptchaProvider from _app.tsx to only Contact page component
But then that's causing error of promise.
If I open / visit contact page, then go to any other page, it will show error like this in console
anchor:1 Uncaught (in promise) TypeError
Promise.then (async)
t @ recaptcha__en.js:147
Promise.then (async)
t @ recaptcha__en.js:147
(anonymous) @ recaptcha__en.js:147
(anonymous) @ recaptcha__en.js:147
(anonymous) @ recaptcha__en.js:76
hM.C @ recaptcha__en.js:935
Z @ recaptcha__en.js:930
(anonymous) @ recaptcha__en.js:938
H @ recaptcha__en.js:416
Meanwhile the error in sentry caught this error
app:///recaptcha/releases/DH3nyJMamEclyfe-nztbfV8S/recaptcha__en.js in Array.<anonymous> at line 529:315
TypeError: Cannot read properties of undefined (reading 'logging')
The text was updated successfully, but these errors were encountered:
herzadinata
changed the title
Captcha GoogleReCaptchaProvider Incurs Promise Error If Only Applied In Specific Page and Not Entire App
GoogleReCaptchaProvider Incurs Promise Error If Only Applied In Specific Page and Not Entire App
Jun 9, 2024
So I have built a website using nextjs 13.1.1 and react-google-recaptcha-v3 1.10.1.
First I put the Provider in the _app.tsx file like this
If I include GoogleReCaptchaProvider globally, everything works fine.
However, since reCAPTCHA is only needed on the contact page, I decided to limit its scope to just that page.
This approach helps to reduce unused JavaScript and improve the Google Chrome Lighthouse score for the other pages.
So I moved GoogleReCaptchaProvider from _app.tsx to only Contact page component
But then that's causing error of promise.
If I open / visit contact page, then go to any other page, it will show error like this in console
Meanwhile the error in sentry caught this error
The text was updated successfully, but these errors were encountered: