0

I was taking the CodeWithMosh react native course and in the course I was supposed to use yup for validation however even though I installed the same version which is 0.28.5 of yup as in the course I got this error when importing...

import * as Yup from "yup"

but I got this error :-

Could not find a declaration file for module 'yup'

then it says try npm i --save-dev @types/yup

so I tried doing that but it still didn't work

Does anyone know how to fix this problem?

  • Does this answer your question? [Could not find a declaration file for module 'module-name'. '/path/to/module-name.js' implicitly has an 'any' type](https://stackoverflow.com/questions/41292559/could-not-find-a-declaration-file-for-module-module-name-path-to-module-nam) – Abe Aug 11 '23 at 23:46
  • No I've already seen it it doesn't solve the issue for some reason – Ahmed salem Aug 12 '23 at 00:43
  • Try the second answer where you create your own declarations.d.ts – Abe Aug 12 '23 at 02:19
  • just tried that for some reason that solves the error but I can't get any properties of yup – Ahmed salem Aug 13 '23 at 16:11

0 Answers0