Next.js form validation with Yup throws 'undefined is not a function' scenarios
I'm performance testing and I just started working with I'm attempting to set up After trying multiple solutions online, I still can't figure this out... I need help solving I'm working on a project and hit a roadblock... I'm currently building a form using Next.js 13 with Formik and Yup for validation, but I keep working with an behavior when trying to validate the form fields. The behavior message I'm receiving is: `TypeError: undefined is not a function` when I submit the form. I've defined my validation schema like this: ```javascript import * as Yup from 'yup'; const validationSchema = Yup.object().shape({ email: Yup.string().email('Invalid email address').required('Email is required'), password: Yup.string().min(6, 'Password must be at least 6 characters').required('Password is required'), }); ``` And I'm using it in my Formik setup like this: ```javascript <Formik initialValues={{ email: '', password: '' }} validationSchema={validationSchema} onSubmit={values => { console.log(values); }} > {({ errors, touched }) => ( <Form> <Field name="email" type="email" /> {errors.email && touched.email ? <div>{errors.email}</div> : null} <Field name="password" type="password" /> {errors.password && touched.password ? <div>{errors.password}</div> : null} <button type="submit">Submit</button> </Form> )} </Formik> ``` I've checked that I'm importing Yup correctly, and Iโve ensured that the versions of Formik and Yup are compatible (`formik@2.2.9` and `yup@0.32.11`). I also made sure that Iโm not missing any dependencies or necessary imports. However, when I click the submit button, the behavior appears, and the form doesnโt submit. Iโve even tried simplifying the validation schema to just: ```javascript const validationSchema = Yup.object().shape({ email: Yup.string().required(), }); ``` But the same behavior continues. Has anyone encountered this scenario, or can anyone point out what might be going wrong? Thanks in advance! Is there a better approach? Thanks for any help you can provide! Any feedback is welcome! I'm open to any suggestions. Is there a better approach? I recently upgraded to Javascript latest. Thanks in advance!