title: Cannot find namespace 'firebase'
body: <p>I am using Ionic 2:    </p>
  
  <blockquote>
  <pre><code>Your system information:
  
   ordova CLI: 6.4.0
  Ionic Framework Version: 2.0.0-rc.4
  Ionic CLI Version: 2.1.18
  Ionic App Lib Version: 2.1.9
  Ionic App Scripts Version: 0.0.47
  ios-deploy version: Not installed
  ios-sim version: Not installed
  OS: Windows 10
  Node Version: v6.9.2
  Xcode version: Not installed
  </code></pre>
  </blockquote>
  
  <p>When I run <code>ionic serve</code>, I get the following error:</p>
  
  <blockquote>
  <pre><code>Typescript Error
  Cannot find namespace 'firebase'.
  ...t/IDE/ionic-apps/theWhoZoo-chat/node_modules/angularfire2/database/database.d.ts
  constructor(fbConfig: FirebaseAppConfig);
  list(urlOrRef: string | firebase.database.Reference, opts?: FirebaseListFactoryOpts): FirebaseListObservable&lt;any[]&gt;;
  object(urlOrRef: string | firebase.database.Reference, opts?: FirebaseObjectFactoryOpts): FirebaseObjectObservable&lt;any&gt;;
  </code></pre>
  </blockquote>
  
  <p>This is a new Ionic project created with <code>ionic start ...</code>. </p>
  
  <p>If anyone can suggest how I can resolve this, I would appreciate it.</p>
  
  <p>I think it may be related to compatibles withing Ionic versions. The reason I say this, is because I am following <a href="https://www.youtube.com/watch?v=bvzuhkEtGPg&amp;index=1&amp;list=PLMEbEXZJWgoR4GAnwXq2mwk9G6ssheukP" rel="nofollow noreferrer">this</a> tutorial, and I guess he isn't using <code>Ionic Framework Version: 2.0.0-rc.4</code>. His example has an <code>app.ts</code>, where I split it into <code>app.module.ts</code> and <code>app.component.ts</code> as required by rc.4.</p>
  
  <p>More info:</p>
  
  <p><strong>typings.json</strong></p>
  
  <pre><code>{
    "globalDependencies": {
      "firebase3": "file:node_modules/angularfire2/firebase3.d.ts"
    }
  }
  </code></pre>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>{
    "name": "ionic-hello-world",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
      "clean": "ionic-app-scripts clean",
      "build": "ionic-app-scripts build",
      "ionic:build": "ionic-app-scripts build",
      "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
      "@angular/common": "2.2.1",
      "@angular/compiler": "2.2.1",
      "@angular/compiler-cli": "2.2.1",
      "@angular/core": "2.2.1",
      "@angular/forms": "2.2.1",
      "@angular/http": "2.2.1",
      "@angular/platform-browser": "2.2.1",
      "@angular/platform-browser-dynamic": "2.2.1",
      "@angular/platform-server": "2.2.1",
      "@ionic/storage": "1.1.7",
      "angularfire2": "^2.0.0-beta.3-0930330",
      "firebase": "^3.3.0",
      "ionic-angular": "2.0.0-rc.4",
      "ionic-native": "2.2.11",
      "ionicons": "3.0.0",
      "rxjs": "5.0.0-beta.12",
      "zone.js": "0.6.26"
    },
    "devDependencies": {
      "@ionic/app-scripts": "0.0.47",
      "typescript": "2.0.9"
    },
    "cordovaPlugins": [
      "cordova-plugin-whitelist",
      "cordova-plugin-console",
      "cordova-plugin-statusbar",
      "cordova-plugin-device",
      "cordova-plugin-splashscreen",
      "ionic-plugin-keyboard"
    ],
    "cordovaPlatforms": [],
    "description": "theWhoZoo-chat: An Ionic project"
  }
  </code></pre>
  
  <p><strong>tsconfig.json</strong></p>
  
  <pre><code>{
    "compilerOptions": {
      "allowSyntheticDefaultImports": true,
      "declaration": false,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "lib": [
        "dom",
        "es2015"
      ],
      "module": "es2015",
      "moduleResolution": "node",
      "sourceMap": true,
      "target": "es5"
    },
    "include": [
      "src/**/*.ts"
    ],
    "exclude": [
      "node_modules"
    ],
    "compileOnSave": false,
    "atom": {
      "rewriteTsconfig": false
    }
  }
  </code></pre>
  
  <p><strong>app.module.ts</strong></p>
  
  <pre><code>import { NgModule, ErrorHandler } from '@angular/core';
  import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
  import { MyApp } from './app.component';
  import { HomePage } from '../pages/home/home';
  import { FIREBASE_PROVIDERS, defaultFirebase, AngularFire, FirebaseAuth } from 'angularfire2';
  
  @NgModule({
    declarations: [
      MyApp,
      HomePage
    ],
    imports: [
      IonicModule.forRoot(MyApp)
    ],
    bootstrap: [IonicApp],
    entryComponents: [
      MyApp,
      HomePage
    ],
    providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler },
      FIREBASE_PROVIDERS, defaultFirebase({
        apiKey: "xxxx",
        authDomain: "xxxx.firebaseapp.com",
        databaseURL: "https://xxxx.firebaseio.com",
        storageBucket: "xxxx.appspot.com"
      })]
  })
  export class AppModule { }
  </code></pre>