TypeError: Object(...) is not a function

I found something that could help, I got the error with version rc.9 in angularfire2 so rolling back to rc.6 solved the error for me:
I first uninstalled firebase and angularfire2 with:

npm uninstall firebase
npm uninstall angularfire2

And then reinstalled again:

npm install angularfire2@5.0.0-rc.6
npm install firebase

and If you find error : ERROR Class ‘FirebaseApp’ incorrectly implements interface ‘App’
then add this line( automaticDataCollectionEnabled:boolean ) in this file.

\node_modules\angularfire2\firebase.app.module.d.ts

correct file contents:
import { InjectionToken } from ‘@angular/core’;
import { FirebaseAppConfig } from ‘./’;
import { FirebaseApp as FBApp } from ‘@firebase/app-types’;
import { FirebaseAuth } from ‘@firebase/auth-types’;
import { FirebaseDatabase } from ‘@firebase/database-types’;
import { FirebaseMessaging } from ‘@firebase/messaging-types’;
import { FirebaseStorage } from ‘@firebase/storage-types’;
import { FirebaseFirestore } from ‘@firebase/firestore-types’;
export declare const FirebaseAppConfigToken: InjectionToken;
export declare class FirebaseApp implements FBApp {
name: string;
automaticDataCollectionEnabled:boolean
options: {};
auth: () => FirebaseAuth;
database: () => FirebaseDatabase;
messaging: () => FirebaseMessaging;
storage: () => FirebaseStorage;
delete: () => Promise;
firestore: () => FirebaseFirestore;
}
export declare function _firebaseAppFactory(config: FirebaseAppConfig, appName?: string): FirebaseApp;

4 Likes