New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebase getAnalytics()
throws Error: Component analytics has not been registered yet
#6019
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
|
This currently suffers from firebase/firebase-js-sdk#6019 and FirebaseExtended/reactfire#490, as well as an unrelated NextJS error.
I haven't tested without reactfire, but |
Same problem with AngularFire, need to come back to 9.6.6 to make it work. |
Same issue here, but on my end it is also with function, app-check, storage and analytics. "firebase": "^9.6.6"
EDIT:
|
Quickfix for me was uninstalling firebase package and re-installing, works for local and production. |
I also tried that, any multiple combinations of reactfire and firebase versions. Does somebody have an idea how to fix it? |
Has anyone reported this issue in the reactfire repo? They may be able to pinpoint the issue better. If anyone is experiencing the same issue in an app that is not using reactfire, feel free to update in this thread. |
I'm also facing this issue. Upgraded to 9.6.8 and then I get "cannot resolve _delegate" |
I'm facing a similar with Angular, firebase 9.8.0 and @angular/fire 7.3.0. For me it seems to only be functions not working. I'm getting the error "Service functions is not available" |
Facing similar issue without using reactfire. Getting the error Error: Component analytics has not been registered yet. I went down from 9.8.1 to 9.6.6 and analytics worked. Not sure if it was 9.6.6 that fixed it or me reinstalling @firebase that fixed it |
I have seen similar errors before caused by different versions of Firebase packages being out of sync, such as having an old The first thing I would try is to delete Another cause of this has been users somehow initialize 2 copies of the Firebase app instance, and some of the packages end up registered to one of the FirebaseApps, and some of the packages end up registered to another one.
If none of this applies, please submit a minimal reproduction of this issue that doesn't include reactfire or angularfire. Just a small repo with only |
@hsubox76 Thanks, it seems to be working for me now. I had already tried deleting node_modules, so I guess it was deleting my yarn.lock that did the trick. |
I'm going to close this but if anyone is still having problems that the above suggestions do not fix, let me know and I will reopen it. |
Describe your environment
Describe the problem
In a NextJS app, attempting to create an
Analytics
object withgetAnalytics(FirebaseApp)
throwsError: Component analytics has not been registered yet
. Strangely, the other SDKs being used (auth, functions, firestore) function as expected; only analytics throws this unregistered error.Logging the value of
firebase._container.providers.get()
for a non-affected SDK (in this case, functions) shows that the component has registered properly, but for analytics the component isnull
.Steps to reproduce:
Create a new NextJS project with reactfire and the Firebase SDKs, then attempt to create an analytics provider in
npm run dev
.The code I am attempting to execute:
which is rendered within
_app.tsx
like so:The text was updated successfully, but these errors were encountered: