There is nothing wrong with the code itself except from the import statement.
change
import Yup, { object } from ‘yup’
to
import * as Yup from “yup”;
You are accessing the object
function through the Yup
CLICK HERE to find out more related problems solutions.