I am not lucky to reproduce your problem. I would advise if this is still a problem if you try the following:
- Check the differences between my configuration below and yours
- View notes for configuring ionic3 here
- Reinstalling npm (it sounds crazy, but sometimes I do it and the problems go away and I see that mine is a little newer than yours).
Configuration
npm
$npm ls -g --depth=0 /Users/pbrack/.nvm/versions/node/v8.5.0/lib โโโ cordova@7.1.0 โโโ cordova-check-plugins@3.0.1 โโโ ionic@3.13.2 โโโ ios-deploy@1.9.2 โโโ npm@5.4.2
Setup steps
$ ionic start angularfire2test blank $ npm install angularfire2 firebase
package.json
{ "name": "angularfire-test", "version": "0.0.1", "author": "Ionic Framework", "homepage": "http://ionicframework.com/", "private": true, "scripts": { "clean": "ionic-app-scripts clean", "build": "ionic-app-scripts build", "lint": "ionic-app-scripts lint", "ionic:build": "ionic-app-scripts build", "ionic:serve": "ionic-app-scripts serve" }, "dependencies": { "@angular/common": "4.4.3", "@angular/compiler": "4.4.3", "@angular/compiler-cli": "4.4.3", "@angular/core": "4.4.3", "@angular/forms": "4.4.3", "@angular/http": "4.4.3", "@angular/platform-browser": "4.4.3", "@angular/platform-browser-dynamic": "4.4.3", "@ionic-native/core": "4.3.0", "@ionic-native/splash-screen": "4.3.0", "@ionic-native/status-bar": "4.3.0", "@ionic/storage": "2.0.1", "angularfire2": "^5.0.0-rc.3", "firebase": "^4.6.0", "ionic-angular": "3.7.1", "ionicons": "3.0.0", "rxjs": "5.4.3", "sw-toolbox": "3.6.0", "zone.js": "0.8.18" }, "devDependencies": { "@ionic/app-scripts": "3.0.0", "typescript": "2.3.4" }, "description": "An Ionic project" }
app.module.ts
import {BrowserModule} from '@angular/platform-browser'; import {ErrorHandler, NgModule} from '@angular/core'; import {IonicApp, IonicErrorHandler, IonicModule} from 'ionic-angular'; import {SplashScreen} from '@ionic-native/splash-screen'; import {StatusBar} from '@ionic-native/status-bar'; import {MyApp} from './app.component'; import {HomePage} from '../pages/home/home'; import {AngularFireModule} from 'angularfire2'; import {AngularFireDatabaseModule, AngularFireDatabase} from 'angularfire2/database'; import {AngularFireAuthModule} from 'angularfire2/auth'; export const firebaseConfig = { apiKey: "xxxxxxxxxx", authDomain: "your-domain-name.firebaseapp.com", databaseURL: "https://your-domain-name.firebaseio.com", storageBucket: "your-domain-name.appspot.com", messagingSenderId: '<your-messaging-sender-id>' }; @NgModule({ declarations: [ MyApp, HomePage ], imports: [ BrowserModule, IonicModule.forRoot(MyApp), AngularFireModule.initializeApp(firebaseConfig), AngularFireDatabaseModule, AngularFireAuthModule ], bootstrap: [IonicApp], entryComponents: [ MyApp, HomePage ], providers: [ StatusBar, SplashScreen, AngularFireDatabase, {provide: ErrorHandler, useClass: IonicErrorHandler} ] }) export class AppModule { }
home.ts
import {Component} from '@angular/core'; import {AngularFireDatabase} from 'angularfire2/database'; import {Observable} from 'rxjs/Observable'; @Component({ selector: 'page-home', templateUrl: 'home.html' }) export class HomePage { items: Observable<any[]>; constructor(afDB: AngularFireDatabase) { this.items = afDB.list('cuisines').valueChanges(); } }