Skip to content

RC.8 fails on ng build --prod #1651

Closed
Closed
@codediodeio

Description

@codediodeio

Version info

Angular: 6.0.1
Firebase: 5.0.2
AngularFire: 5.0.0-rc.8.0

How to reproduce these conditions

  1. Follow AngularFire2 setup instructions
  2. Run ng build --prod

Debug output

ERROR in Error during template compile of 'AppModule'
Function calls are not supported in decorators but 'AngularFireModule' was called.

Expected behavior

Build should run successfully.

Actual behavior

Build fails only in production (AOT)

Problem

I don't think the Angular compiler can analyze code dynamically in initializeApp. These lines are the source of the problem

https://github.com/angular/angularfire2/blob/a8414f5d62ec073db760e0b7e9346e4d946bd3a3/src/core/firebase.app.module.ts#L50-L51

Possible Solution?

Require the second arg to initializeApp to be a FirebaseAppConfig object and remove the string union type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions