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
/node_modules/remix-hook-form/dist/index.js:129
useSubmit
^^^^^^^^^
SyntaxError: Named export 'useSubmit' not found. The requested module 'react-router' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'react-router';
at ModuleJob._instantiate (node:internal/modules/esm/module_job:131:21)
at ModuleJob.run (node:internal/modules/esm/module_job:213:5)
at ModuleLoader.import (node:internal/modules/esm/loader:316:24)
Example
import*asyupfrom"yup";exportconstSignUpSchema=yup.object().shape({firstName: yup.string().required("First Name is required"),lastName: yup.string().required("Last Name is required"),email: yup.string().email().required("Email Address is required"),phone: yup.string().required("Phone Number is required"),password: yup.string().required("Password is required"),confirmPassword: yup.string().required("Confirm your Password").oneOf([yup.ref("password")],"Passwords must match"),address1: yup.string().required("Address 1 is required"),address2: yup.string().optional(),gender: yup.string().required("gender is required"),timeZone: yup.string().optional(),city: yup.string().required("City is required"),state: yup.string().required("State is required"),postCode: yup.string().required("Post Code is required"),});exporttypeSignUpSchema=yup.InferType<typeofSignUpSchema>;const{
handleSubmit,formState: { errors },
register,}=useRemixForm<SignUpSchema>({mode: "onSubmit",resolver: yupResolver(SignUpSchema),});
The text was updated successfully, but these errors were encountered:
copy-ninja1
changed the title
Error while trying to to use it with yup and yup resolver
Error while trying to use it with yup and yup resolver
Jan 26, 2025
/node_modules/remix-hook-form/dist/index.js:129
useSubmit
^^^^^^^^^
SyntaxError: Named export 'useSubmit' not found. The requested module 'react-router' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'react-router';
Example
The text was updated successfully, but these errors were encountered: