Error while building Next.js application for production

48 Views Asked by At

I am using react-google-recaptcha package im my application it is working fine in my development environment, but when i try to build the application for the production it is throwing something like type error, i have attached the image below and here is my code,

 <ReCAPTCHA
            sitekey={siteKey as string}
            ref={captchaRef}
            onChange={() => setReCaptchaError(false)}
            data-testid={"recaptcha"}
          />

Error image

I have tried to downgrade the @types/react and @types/react-dom version to 17.0.2 it fixed that issue but i am using Formik in my application, and in some places i am using <Form> tag from the formik, if i downgrade the version it is throwing error in formik <Form> component. Please help me to fix this issue guys.

0

There are 0 best solutions below