angularfire: Firebase is not a constructor
I wanted to start a new app (firebase 3) using typescript and angular 2 (2.0.0-rc.1) and webpack, so i followed the current instructions but installed following #184
npm install angularfire2 firebase@2.4.2 --save
I created the global providers like:
bootstrap(AppComponent, [
FIREBASE_PROVIDERS,
defaultFirebase('https://XXX.firebaseio.com'),
])
And included it in my component as
constructor(af: AngularFire) {
this.employees = af.database.list('/employees');
}
But i am getting an error saying:
ORIGINAL EXCEPTION: TypeError: Firebase is not a constructor
I dont know if it is related to the new firebase release, but i found a comment here: https://github.com/angular/angularfire2/issues/180#issuecomment-220314899
I just want to get started, no specific needs, so any workaround will do it for me for the time beeing
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (2 by maintainers)
I was developing a hobby project using Ionic 2 and decided to switch back to firebase 2.4.2 for the time being. Its functional for me 😄
Your webpack config may be resolving json files. http://webpack.github.io/docs/configuration.html#resolve-extensions