antokara / react-recaptcha-x

a React reCAPTCHA version 3 and version 2 (checkbox) component in one.
MIT License
23 stars 11 forks source link

Build with CRA #50

Closed VyacheslavKazadaev closed 3 years ago

VyacheslavKazadaev commented 3 years ago

Describe the bug Error while assembling the CRA project with typescrypt. Error: Uncaught (in promise) null.

To Reproduce Steps to reproduce the behavior:

  1. Let's take an example
    <ReCaptchaProvider
      siteKeyV2={process.env.REACT_APP_RECAPTCHA_V2_SITE_KEY}
      siteKeyV3={process.env.REACT_APP_RECAPTCHA_V3_SITE_KEY}
      langCode={'en'}
      hideV3Badge={true}
    >
      <ReCaptchaV3 action="login" callback={v3Callback} />
      {enableV2 ? (
        <ReCaptchaV2
          callback={v2Callback}
          theme={EReCaptchaV2Theme.Light}
          size={EReCaptchaV2Size.Normal}
          id="my-id"
          data-test-id="my-test-id"
          tabindex={0}
        />
      ) : null}
    </ReCaptchaProvider>
  2. npm run build
  3. Refresh page and get error in console!
VyacheslavKazadaev commented 3 years ago

Sorry! Mismatch of the address specified in the captcha settings.