0

I am trying to load dynamic values to initialize angularfire2 but it errors out when using aot.

let _env = {
        apiKey: 'key...',
        authDomain: dynamicValueFromConfig,
        databaseURL: 'url...',
        projectId: 'id...',
        storageBucket: 'bucket id...',
        messagingSenderId: 'messaging id...'

imports: [
    AngularFireModule.initializeApp(_env), // issue here
    ...

This is a known issue and there are some answers for older versions: AngularFire2 App Init in Module Conflicts with Dynamic Config Data

But I can't make it work with AngularFire v5... Angular 6 using Webpack.

smorhaim
  • 778
  • 1
  • 9
  • 24

1 Answers1

1

Try giving FirebaseOptionsToken in the providers array. Like this { provide: FirebaseOptionsToken, useValue: _env}

More about this issue, refer this.

KiraAG
  • 773
  • 4
  • 19