# Error using Joi-browser library

**URL:** <https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165>\
**Category:** React\
**Created:** [August 5, 2022, 7:30pm UTC](https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165 "2022-08-05T19:30:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlmTalal](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AlmTalal](https://forum.codewithmosh.com/u/AlmTalal)\
**Post date:** [August 5, 2022, 7:30pm UTC](https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165/1 "2022-08-05T19:30:33Z")

</div>

Hello! I’m doing the react course, but I am getting an error when I use the Joi-browser library. The error is this :

Could not find a declaration file for module ‘joi-browser’. ‘C:/Users/almta/OneDrive/Escritorio/vidly-project/node\_modules/joi-browser/dist/joi-browser.js’ implicitly has an ‘any’ type.  
Try `npm i --save-dev @types/joi-browser` if it exists or add a new declaration (.d.ts) file containing `declare module 'joi-browser';`

I searched for the file in the node-modules folder and i found it, I make sure about importing the module right, but still does not work, what can i do ?

This is whta appears in the console:

Uncaught TypeError: Cannot read properties of undefined (reading ‘string’)  
at new RegisterMovieForm (registerMovie.jsx:21:1)  
at constructClassInstance (react-dom.development.js:14323:1).

But that is a method of Joi library

---

<div class="post-metadata">

**Author:** ![mykfrost](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/mykfrost/32/3918_2.png) [@mykfrost](https://forum.codewithmosh.com/u/mykfrost)\
**Post date:** [August 6, 2022, 9:31am UTC](https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165/2 "2022-08-06T09:31:24Z")

</div>

I have the same problem.

---

<div class="post-metadata">

**Author:** ![AlmTalal](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AlmTalal](https://forum.codewithmosh.com/u/AlmTalal)\
**Post date:** [August 6, 2022, 2:00pm UTC](https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165/3 "2022-08-06T14:00:08Z")

</div>

I already solve it, just open your terminal and desinstall joi browser using this command “npm uninstall -D joi-browser”, and then install it another time, but this time without the version that mosh uses, (with this command “npm i joi-browser”). By the way, since we are in the same part of the course i would like to study together. I think that the only thing that i miss about the schools or college are the partners hahaha

---

<div class="post-metadata">

**Author:** ![mykfrost](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/mykfrost/32/3918_2.png) [@mykfrost](https://forum.codewithmosh.com/u/mykfrost)\
**Post date:** [August 9, 2022, 11:14am UTC](https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165/4 "2022-08-09T11:14:50Z")

</div>

> [@AlmTalal](#):
>
> npm i joi-browser

hey man , yes we can. How are we going to do that ? I just came accross the same error when installing the Node back end.

---

<div class="post-metadata">

**Author:** ![AlmTalal](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AlmTalal](https://forum.codewithmosh.com/u/AlmTalal)\
**Post date:** [August 10, 2022, 2:44pm UTC](https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165/5 "2022-08-10T14:44:47Z")

</div>

Mm I’m still not at that part of the course hahah now I’m having an issue with the React-Toastify library

---

<div class="post-metadata">

**Author:** ![mykfrost](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/mykfrost/32/3918_2.png) [@mykfrost](https://forum.codewithmosh.com/u/mykfrost)\
**Post date:** [August 10, 2022, 6:05pm UTC](https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165/6 "2022-08-10T18:05:34Z")

</div>

Did you sort it out ? I relized that Bootstrap had toast too , check if u chose the right toast

---

<div class="post-metadata">

**Author:** ![AlmTalal](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@AlmTalal](https://forum.codewithmosh.com/u/AlmTalal)\
**Post date:** [August 10, 2022, 7:24pm UTC](https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165/7 "2022-08-10T19:24:56Z")

</div>

I don’t think that the problem is in the code, what appears in my console is this “/node\_modules/react-toastify/dist/react-toastify.esm.mjs  
Module build failed: Error: ENOENT: no such file or directory, open” Im sure that it is in the directory beacause i search for it and I’m sure that i wrote it well when I import it

---

<div class="post-metadata">

**Author:** ![FMckinnon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/fmckinnon/32/4589_2.png) [@FMckinnon](https://forum.codewithmosh.com/u/FMckinnon)\
**Post date:** [September 9, 2022, 3:09pm UTC](https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165/8 "2022-09-09T15:09:52Z")

</div>

Did you ever find a solution to this? I am also having issues with toastify, I assume its to do with using the latest version with Mosh’s outdated downloaded http-app

---

<div class="post-metadata">

**Author:** ![muhannadabbady](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@muhannadabbady](https://forum.codewithmosh.com/u/muhannadabbady)\
**Post date:** [July 2, 2024, 1:12am UTC](https://forum.codewithmosh.com/t/error-using-joi-browser-library/14165/9 "2024-07-02T01:12:55Z")

</div>

create a new TypeScript declaration file (`.d.ts` ) in your project (e.g., `joi-browser.d.ts` )

```auto
declare module 'joi-browser';

```

This tells TypeScript that the module `'joi-browser'` exists
