-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Firestore - Error: Uncaught (in promise): TypeError: app.firestore is not a function #1374
Comments
Hi @cesarsalesgomes! Can you create a Stackblitz.com that shows this error? I think there might be an issue with the module setup. |
@davideast Hi! Git project helps? This is a server-side rendering app with cloud functions to host my syster-in-law restaurant site. It's a way to repay her for letting me eat there for free =D Here's the link: |
I previously had that problem as well after upgrading. But when I started a new project, and installed the exact same versions of angular, firebase and angularfire, the problem went away. I suggest removing node_modules, clearing npm cache (npm cache clean) and doing npm install again. I'm currently on versions: angular 5.1.0, angularfire2 5.0.0-rc.4 and firebase 4.8.0 |
Tried @WanderG suggestion and no luck so far, still the same error appears. These are my package json dependecies Am I missing something? |
Don't see anything wrong there. Perhaps something to do with how you import them? I only had the error when I used auth in an angular guard (for a route with canActivate), I assume you're doing the same? In my app.module.ts:
In my AuthGuard:
You can try starting a new project, copying your package.json and create a minimal app to see if it works there. |
My suggestion would be the same as @WanderG, creating a minimal app. In my situation, i just needed to trigger a cloud function. So, instead of triggering via firestore updating, i called the cloud function rest api directly, and stopped using firestore. But in another project, I would have to double the attention if I was going to use firestore. |
@xjuanc by bad luck I ran into this exact problem again today. |
Really appreciate your help guys, I did what you suggested and it worked like a charm when doing so in a brand new project, the odd part is there was no difference at all in node modules so what I have done so far is:
Anyway, problem fixed with the last solution provided by @WanderG. Hope you all enjoy christmas! |
I was getting this error on 5.0.0-rc.10. Rolling back to 5.0.0-rc.9 solved it for me. |
**Version Info
Angular: ^5.0.2
Firebase: ^4.6.0
AngularFire2: ^5.0.0-rc.3**
I've done all the steps to use AngularFirestore normally, but when i'm instantiating in my constructor service, this error brokes my app.
import { Injectable } from '@angular/core';
import { AngularFirestore } from 'angularfire2/firestore';
@Injectable()
export class ContactFormService {
constructor(
private afs: AngularFirestore
) { }
}
The text was updated successfully, but these errors were encountered: