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

angular cli build with AOT mode fail with @Inject(FirebaseApp) firebaseApp: firebase.app.App does not work with angular cli AOT mode #799

Closed
morninng opened this issue Jan 29, 2017 · 6 comments

Comments

@morninng
Copy link

I am using firebase storage in my web app and I am using following code to refer the firebase function which is not implemented in angularfire2.

@Injectable()
export class LoggerService {
constructor( @Inject(FirebaseApp) firebaseApp: firebase.app.App) {

However because of this code, "ng build --aot" fail with error.
"ng build" succeed without any issue but I cannot use aot mode.

Version info

Angular:
"@angular/common": "^2.3.1",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.3.1",
Firebase:
"firebase": "^3.6.7",
AngularFire:
"angularfire2": "^2.0.0-beta.7",

Other
ubuntu 16.04
node v6.9.2

command to reproduce issue
ng build --aot

source code
@Injectable()
export class LoggerService {
constructor( @Inject(FirebaseApp) firebaseApp: firebase.app.App) {

Errors in terminal

ERROR in Error encountered resolving symbol values statically. Expression form not supported (position 87:49 in the original .ts file), resolving symbol LoggerService in /home/morninng/development/Angular2/mixidea_cowork/src/app/core/service/logger.service.ts

@davideast
Copy link
Member

Unfortunately this is an issue with the Angular compiler and we are waiting on it to get fixed.

Follow #653 and angular/angular#12631 to keep updated.

@morninng
Copy link
Author

I still cannot use Firebase with AOT mode by Angular4.1.0.
As AOT become the default compile setting, I want to use AOT mode, but it is not possible with @Inject(FirebaseApp.

@davideast
Copy link
Member

@morninng Install the next tag and inject FirebaseApp

npm i angularfire2@next --save

@morninng
Copy link
Author

@davideast
Oh thank you very much. I will try

@adsonrocha
Copy link

@morninng have you fixed the issue?

@adsonrocha
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants