Angularfire: RC4 install produces "Error: Metadata version mismatch for module angularfire2/index.d.ts, found version 4 expected 3, resolving symbol AppModule"

Created on 6 Jan 2018  ยท  7Comments  ยท  Source: angular/angularfire

This looks similar to #1397. I can create a complete repro if needed, but I've literally followed the install guide to the letter.

Version info

Sputnik:test-af2 katowulf$ npm list | grep angular
โ”œโ”€โ”ฌ @angular/[email protected]
โ”œโ”€โ”ฌ @angular/[email protected]
โ”‚ โ”œโ”€โ”ฌ @angular-devkit/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”ฌ @angular-devkit/[email protected]
โ”‚ โ”œโ”€โ”ฌ @schematics/[email protected]
โ”‚ โ”‚ โ””โ”€โ”ฌ @angular-devkit/[email protected]
โ”œโ”€โ”ฌ @angular/[email protected]
โ”œโ”€โ”ฌ @angular/[email protected]
โ”‚ โ”œโ”€โ”ฌ @angular/[email protected]
โ”œโ”€โ”ฌ @angular/[email protected]
โ”œโ”€โ”ฌ @angular/[email protected]
โ”œโ”€โ”€ @angular/[email protected]
โ”œโ”€โ”ฌ @angular/[email protected]
โ”œโ”€โ”€ [email protected]

Sputnik:test-af2 katowulf$ npm list | grep fire
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”ฌ @firebase/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ @firebase/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @firebase/[email protected]
โ”‚ โ”œโ”€โ”ฌ @firebase/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @firebase/[email protected]
โ”‚ โ”œโ”€โ”ฌ @firebase/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ @firebase/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ @firebase/[email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @firebase/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ @firebase/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ @firebase/[email protected]
[email protected]@schematics/[email protected]
โ”‚ โ”œโ”€โ”ฌ @firebase/[email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ @firebase/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @firebase/[email protected] deduped
โ”‚ โ”œโ”€โ”ฌ @firebase/[email protected]
โ”‚ โ”œโ”€โ”ฌ @firebase/[email protected]
โ”‚ โ”‚ โ””โ”€โ”€ @firebase/[email protected]

How to reproduce these conditions

  1. Follow setup steps described in readme
  2. Run ng serve after installing AF2
  3. Fails with errors described below.

Debug output

* Errors in the JavaScript console *

This error appears upon running ng serve immediately after adding AngularFireModule.initializeApp(environment.firebase), into my app.module.ts and running ng serve

ERROR in /Users/katowulf/projects/test-af2/node_modules/angularfire2/firebase.app.module.d.ts (5,45): Cannot find namespace 'firebase'.
ERROR in /Users/katowulf/projects/test-af2/node_modules/angularfire2/firebase.app.module.d.ts (8,17): Cannot find namespace 'firebase'.
ERROR in /Users/katowulf/projects/test-af2/node_modules/angularfire2/firebase.app.module.d.ts (9,21): Cannot find namespace 'firebase'.
ERROR in /Users/katowulf/projects/test-af2/node_modules/angularfire2/firebase.app.module.d.ts (10,22): Cannot find namespace 'firebase'.
ERROR in /Users/katowulf/projects/test-af2/node_modules/angularfire2/firebase.app.module.d.ts (11,20): Cannot find namespace 'firebase'.
ERROR in /Users/katowulf/projects/test-af2/node_modules/angularfire2/firebase.app.module.d.ts (13,22): Cannot find namespace 'firebase'.
ERROR in Error: Metadata version mismatch for module /Users/katowulf/projects/test-af2/node_modules/angularfire2/index.d.ts, found version 4, expected 3, resolving symbol AppModule in /Users/katowulf/projects/test-af2/src/app/app.module.ts, resolving symbol AppModule in /Users/katowulf/projects/test-af2/src/app/app.module.ts, resolving symbol AppModule in /Users/katowulf/projects/test-af2/src/app/app.module.ts
    at syntaxError (/Users/katowulf/projects/test-af2/node_modules/@angular/compiler/bundles/compiler.umd.js:1729:34)
    at simplifyInContext (/Users/katowulf/projects/test-af2/node_modules/@angular/compiler/bundles/compiler.umd.js:24979:23)
    at StaticReflector.simplify (/Users/katowulf/projects/test-af2/node_modules/@angular/compiler/bundles/compiler.umd.js:24991:13)
    at StaticReflector.annotations (/Users/katowulf/projects/test-af2/node_modules/@angular/compiler/bundles/compiler.umd.js:24418:41)
    at _getNgModuleMetadata (/Users/katowulf/projects/test-af2/node_modules/@angular/compiler-cli/src/ngtools_impl.js:138:31)
    at _extractLazyRoutesFromStaticModule (/Users/katowulf/projects/test-af2/node_modules/@angular/compiler-cli/src/ngtools_impl.js:109:26)
    at Object.listLazyRoutesOfModule (/Users/katowulf/projects/test-af2/node_modules/@angular/compiler-cli/src/ngtools_impl.js:53:22)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (/Users/katowulf/projects/test-af2/node_modules/@angular/compiler-cli/src/ngtools_api.js:91:39)
    at AotPlugin._getLazyRoutesFromNgtools (/Users/katowulf/projects/test-af2/node_modules/@ngtools/webpack/src/plugin.js:212:44)
    at _donePromise.Promise.resolve.then.then.then.then.then (/Users/katowulf/projects/test-af2/node_modules/@ngtools/webpack/src/plugin.js:448:24)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

* Output from firebase.database().enableLogging(true); *

n/a

Expected behavior

Should compile and start server when following install directions exactly.

Actual behavior

Receive version mismatch in angularfire2/index.d.ts.

Most helpful comment

@gauravweni try to
' npm install [email protected] --save '

All 7 comments

Reverting to RC3 resolves the "mismatch" error
Forcing Firebase 4.8.0 resolves "Cannot find namespace 'firebase'." as described in #1387

Should be fixed with the current next release. npm i angularfire2@next.

Metadata version mismatch for module E:/fhc-app-temp/node_modules/angularfire2/index.d.ts, found version 4, expected 3 getting this error plz help me

@gauravweni try to
' npm install [email protected] --save '

Fixed in the latest release.

I think this error is back. Getting it on brand new project:
"angularfire2": "^5.0.0-rc.10",
"firebase": "^5.0.4",

I'm getting this error in the 5.1.1 release. I have no idea how to fix it. I tried downgrading to 5.0.0.rc3 and rc4 but it didn't work

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mypark picture mypark  ยท  3Comments

Leanvitale picture Leanvitale  ยท  3Comments

fisherds picture fisherds  ยท  3Comments

jteplitz picture jteplitz  ยท  3Comments

aucevica picture aucevica  ยท  3Comments