Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!