Angularfire: stuck at step 3 setting up a new project

Created on 24 Aug 2016  路  4Comments  路  Source: angular/angularfire

followed installation guide, created a new project, installed firebase and angularfire2, replaced the main.ts file with the one provided (and added the firebase config).

After that my app does not compile, I get multiple errors like this :
.../node_modules/angularfire2/angularfire2.d.ts:13:65
Cannot find namespace 'firebase'.

Most helpful comment

Same mistake here: Error with "ng build && ng serve" following "Installation and Setup" guide

The problem at the moment is not resolved at home. The additional step that was provided to us was to add firebase in tsconfig.json in array types and to update typescript in its latest version with the command:

npm install -g typescript@next
npm install typescript@next --save-dev

and tsconfig:

{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ],
    "types": [
      "jasmine",
      "firebase"
    ]
  }
}

But this raises worries on my side I now full of new errors . In case if it can help.

All 4 comments

Had the Same problem on my Ionic App and had to revert to Beta.2.
What Angular RC version are you using?

Same mistake here: Error with "ng build && ng serve" following "Installation and Setup" guide

The problem at the moment is not resolved at home. The additional step that was provided to us was to add firebase in tsconfig.json in array types and to update typescript in its latest version with the command:

npm install -g typescript@next
npm install typescript@next --save-dev

and tsconfig:

{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ],
    "types": [
      "jasmine",
      "firebase"
    ]
  }
}

But this raises worries on my side I now full of new errors . In case if it can help.

you can import firebase to the module file where you init angularfire
import * as firebase from 'firebase'

Thanks cre8, that solved the issue for me

Was this page helpful?
0 / 5 - 0 ratings