Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React: Module not found: Can't resolve 'react-firebase'hooks' in 'C:\Users\<Name>\Web Dev\Firechat\firechat\src'

So I am attempting to make a web app with React, Firebase, and the react-firebase-hooks module and I can't even get my code to compile. I have uninstalled react-firebase-hooks at least 3 times now and re-installed it just the same. I even installed it globally. My output from npm list is:

npm list

Firebase resolves fine and there are no issues, so it can't be that something isn't installed. In my code, I am using:

import {useAuthState} from 'react-firebase-hooks';
import {useCollectionData} from 'react-firebase-hooks/firestore';

To import useAuthState and useCollectionData from react-firebase-hooks.

Has anyone else had any issues with this? Is this some sort of compatibility issue that I'm not noticing? I also created a totally separate project running

npx create-react-app test

and then

cd test

followed by

npm install --save react-firebase-hooks 

, imported the same 2 components from that module, ran my code with

npm start

and got the same error as I did in my actual app.

I also used

rm -rf node_modules

and then ran

npm install

to no avail.

I am fairly new to the web dev world as well as React and Firebase so please forgive me if I'm overlooking something here.

like image 732
PapaPete Avatar asked Oct 16 '25 16:10

PapaPete


1 Answers

The useAuthState comes from "react-firebase-hooks/auth" modeule, that's why it's not working

like image 69
Oluwatowo Rosanwo Avatar answered Oct 18 '25 07:10

Oluwatowo Rosanwo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!