You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can use app.initializeApp(config) to create a FirebaseApp app.
But Typescript is never happy.
The 2 errors I get are:
Property 'automaticDataCollectionEnabled' is missing in type 'App' but required in type 'FirebaseApp'. TS2741
or
Argument of type 'FirebaseAppConfig' is not assignable to parameter of type 'string'. TS2345
Steps to reproduce: Without the AppConfig, name as string
Types from @firebase/app-types are not meant to be used directly. You should only use the types directly exposed by import * as firebase from firebase. For example:
Problem:
I can use
app.initializeApp(config)
to create aFirebaseApp
app.But Typescript is never happy.
The 2 errors I get are:
Steps to reproduce: Without the AppConfig, name as string
Results in error:
Steps to reproduce: With the AppConfig
Results in error:
Possible solution
I suspect that maybe types and JS code have diverged a bit?
https://github.com/firebase/firebase-js-sdk/blob/master/packages/app-types/index.d.ts#L49
When I'm looking at the overloaded types def of
initializeApp()
I see both supported, but I can't us the config based one.Also, I see that
automaticDataCollectionEnabled
is optional in the config, but required in the app itself.The text was updated successfully, but these errors were encountered: