Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

141
Vistas
yup validation library TypeError: yup__WEBPACK_IMPORTED_MODULE_0__ is not a function

I have installed yup and tried to validate my form with this, however when I try to import it to a file I get this error. I do not even run the handler, it just errors me out on page load. I use it with react.

this is my code

import * as yup from "yup";

export const detailsSchema = yup.object().shape({
    cheeseType: yup()
        .string()
        .isRequired()
});

I tried to rm -rf node_modules, I did not help.

Thanks for helping me out.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It solved this error I used wrong method - isRequired() instead of required() and also here I was wrong:

cheeseType: yup()
        .string()
        .isRequired()

should be

cheeseType: yup
        .string()
        .isRequired()

so the correct schema looks like

cheeseType: yup
        .string()
        .required()

All the best! :)

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda