Skip to content
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

Update firebase.app.module.ts #1572

Merged
merged 1 commit into from
Apr 21, 2018
Merged

Conversation

MingyuJeon
Copy link
Contributor

Checklist

Description

Bug fix

Class FirebaseApp incorrectly implements interface 'FirebaseApp'.
Property `automaticDataCollectionEnabled` is missing in type FirebaseApp 

Code sample

firebase.app.module.d.ts

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<FirebaseAppConfig>;

export declare class FirebaseApp implements FBApp {
  name: string;
  automaticDataCollectionEnabled: boolean; // add here
  options: {};
  auth: () => FirebaseAuth;
  database: () => FirebaseDatabase;
  messaging: () => FirebaseMessaging;
  storage: () => FirebaseStorage;
  delete: () => Promise<any>;
  firestore: () => FirebaseFirestore;
}

export declare function _firebaseAppFactory(config: FirebaseAppConfig, appName?: string): FirebaseApp;

Fix:
Class FirebaseApp incorrectly implements interface 'FirebaseApp'.
Property `automaticDataCollectionEnabled` is missing in type FirebaseApp
Copy link
Contributor

@sarunint sarunint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we allow assigning the automaticDataCollectionEnabled parameter from the initializeApp method? This may lead to breaking change.

Copy link

@Adonaye Adonaye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried this solution and works well.
I changed it myself but users of Ionic Pro can not deal with it. It would be great to try it.

@MingyuJeon
Copy link
Contributor Author

MingyuJeon commented Apr 20, 2018

Even though you change firebase.app.module.ts to this, the error could happen because ionic pro npm install automatically when it build an app. So, if the error occurs, you would need to downgrade to @firebase/app@0.1.10 in this situation.

@jamesdaniels jamesdaniels merged commit f2cf159 into angular:master Apr 21, 2018
@jamesdaniels
Copy link
Member

Thanks for the quick fix.

@jamesdaniels
Copy link
Member

@sarunint I'll support the new Firebase initialize method style, which takes automaticDataCollectionEnabled as an argument in a follow on PR. Will want to bump the req in the package.json for that one.

@luq-sparrow
Copy link

luq-sparrow commented Apr 27, 2018

The problem still occurs in Angular CLI.
I'm not using firebase/app.
Only angularfire2 and firebase to manage firestore calls.

Same error.

@sarunint
Copy link
Contributor

That's because the fix in this PR has not been released yet.

@software770-2
Copy link

Is it realesed today ? How Do I fix it now ?

@MingyuJeon MingyuJeon deleted the patch-1 branch May 3, 2018 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants