FirebaseExtended / reactfire

Hooks, Context Providers, and Components that make it easy to interact with Firebase.
https://firebaseopensource.com/projects/firebaseextended/reactfire/
MIT License
3.52k stars 401 forks source link

Cannot use any provider except FirebaseAppProvider #467

Closed JurgenPalsma closed 2 years ago

JurgenPalsma commented 2 years ago

Any provider import except FirebaseAppProvider gives me an error: Attempted import error: 'FunctionsProvider' is not exported from 'reactfire'.

Version info

"@firebase/functions": "^0.7.2", "@firebase/storage": "^0.8.2", "@types/react": "^17.0.15", "firebase": "^8.8.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-firebaseui": "^5.0.2", "react-router-dom": "^5.2.0", "react-scripts": "4.0.3", "reactfire": "^3.0.0-rc.3", "typescript": "^4.3.5", "web-vitals": "^1.0.1"

Steps to reproduce

eg:import {FunctionsProvider} from 'reactfire';

Expected behavior

Import success :)

Actual behavior

Attempted import error: 'FunctionsProvider' is not exported from 'reactfire'.

epodol commented 2 years ago

FunctionsProvider is only needed/available for for firebase v9 (modular). You only have v8.8.1 (not modular) installed. So unless you update firebase to the latest version as well, you do not need to update reactfire.

If you update to the latest firebase version, you will need to update to the latest reactfire version. Try manually running npm i reactfire@4.2.0.

Also, you are installing @firebase/functions and @firebase/storage. These both are included in firebase and should not be installed individually. From the firebase JS SDK GitHub repo:

This package is not intended for direct usage, and should only be used via the officially supported firebase package.

jhuleatt commented 2 years ago

Thanks @epodol, that's correct. @JurgenPalsma, please take a look at the upgrade guide for more tips on moving to ReactFire v4.

If you run into trouble when upgrading, feel free to file another issue, as we'd be happy to improve the upgrade guide. If you're not ready to upgrade yet, the v3 branch contains docs and source code for ReactFire v3.

JurgenPalsma commented 2 years ago

thank you all for the clarifications and super fast answer