Attempted import error: 'Yup' does not contain a default export (Imported as 'Yup'). NPM

Asked

Viewed 690 times

-1

I am creating a site with authentication service and in it I intend to use Yup, an NPM module. I installed everything right but when I start the application it appears:

Attempted import error: 'yup' does not contain a default export (imported as 'yup').

I have tried several things but always the same error in npm.

  • enter at the end of the code the "export default Yup"

1 answer

0


How are you importing Yup into your project ? It doesn’t have a standard export, so you can’t import it this way: import yup from 'yup', you need to import it like this import * as yup from 'yup' to have access to all resources, or to unstructure for a specific resource. See here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.