score:0

import * as yup from 'yup'

not sure why that works but i was having the same problem and it worked for me.

score:1

i'm not sure why it works locally and not on codesandbox but i can tell you know it isn't working on codesandbox.

yup does not have a default export e.g. export { string, object etc }. see: https://github.com/jquense/yup/blob/master/src/index.js

doing import yup from 'yup' would mean that yup is undefined. if you wanted to using import syntax you could do import * as yup from 'yup' then do yup.object() or use require - var yup = require('yup')


Related Query

More Query from same tag