4

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.

PapaPete
  • 351
  • 3
  • 12
  • I tried it, but wasn't able to reproduce the problem. Try looking elsewhere. Since it occurs on a new application, it's unlikely something to do with your code in the other application. I find that restarting the computer works when nothing else does. – Shamar Yarde Jul 30 '21 at 22:23
  • @ShamarYarde I didn't even think about restarting. I just went ahead and tried restart and no luck however. – PapaPete Jul 30 '21 at 23:07
  • I was able to solve this issue by [completely uninstalling node.js](https://stackoverflow.com/questions/20711240/how-to-completely-remove-node-js-from-windows) – PapaPete Jul 31 '21 at 00:05

1 Answers1

13

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