Obtengo UnhandledPromiseRejectionWarning: TypeError: Yup.string.required no es una función en _callee $ error desde yup cada vez que envío una solicitud de publicación usando cartero

import * as Yup from "yup"; import {PROVIDER_ENUM} from './customer.model'; export const create = async (req, res) ={amp}gt; { const {token, provider } = req.body; const bodySchema = Yup.object().shape({ token: Yup.string().required(), provider: Yup.string() .oneOf(PROVIDER_ENUM) .required(), }); try { await bodySchema.validate({token, provider}); res.status(201).json({message:'success'}) } catch (error) { res.status(400).json({ message: error.message}); } } 

Aquí está el mensaje de error completo:

 (node:11240) UnhandledPromiseRejectionWarning: TypeError: Yup.string.required is not a function at _callee$ (C:/native/lasprice/server/src/modules/customer/customer.controller.js:10:27) at tryCatch (C:nativelaspriceservernode_modulesregenerator-runtimeruntime.js:65:40) at Generator.invoke [as _invoke] (C:nativelaspriceservernode_modulesregenerator-runtimeruntime.js:303:22) at Generator.prototype.(anonymous function) [as next] (C:nativelaspriceservernode_modulesregenerator-runtimeruntime.js:117:21) at step (C:nativelaspriceserversrcmodulescustomercustomer.controller.js:16:191) at C:nativelaspriceserversrcmodulescustomercustomer.controller.js:16:437 at new Promise ({amp}lt;anonymous{amp}gt;) at C:nativelaspriceserversrcmodulescustomercustomer.controller.js:16:99 at create (C:/native/lasprice/server/src/modules/customer/customer.controller.js:6:14) at Layer.handle [as handle_request] (C:nativelaspriceservernode_modulesexpresslibrouterlayer.js:95:5) at next (C:nativelaspriceservernode_modulesexpresslibrouterroute.js:137:13) at Route.dispatch (C:nativelaspriceservernode_modulesexpresslibrouterroute.js:112:3) at Layer.handle [as handle_request] (C:nativelaspriceservernode_modulesexpresslibrouterlayer.js:95:5) at C:nativelaspriceservernode_modulesexpresslibrouterindex.js:281:22 at Function.process_params (C:nativelaspriceservernode_modulesexpresslibrouterindex.js:335:12) at next (C:nativelaspriceservernode_modulesexpresslibrouterindex.js:275:10) (node:11240) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:11240) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.