In this version(mine is 1.6.1) of yup, you should use arrow functions for then
and otherwise
.
For Example:
then: () => yup.number().min(0).max(100).required(),
otherwise: () => yup.number().nullable().transform(emptyToNullTransform),
I just added ()=>
to the code
the source that explained it: This page