Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

142
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda