angularfire: 2.0.0-beta.6 Duplicate identifiers / ERRORS
Think I found a bug
After adding Angular Fire to my project, which I have created with angular-cli
, I get the following errors when I start the app with ng serve
:
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:150:8
Duplicate identifier 'FacebookAuthProvider_Instance'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:155:8
Duplicate identifier 'GithubAuthProvider'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:159:8
Duplicate identifier 'GithubAuthProvider_Instance'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:164:8
Duplicate identifier 'GoogleAuthProvider'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:169:8
Duplicate identifier 'GoogleAuthProvider_Instance'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:174:8
Duplicate identifier 'TwitterAuthProvider'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:179:8
Duplicate identifier 'TwitterAuthProvider_Instance'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:183:7
Duplicate identifier 'UserCredential'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:354:7
Duplicate identifier 'StringFormat'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:355:6
Duplicate identifier 'StringFormat'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:362:7
Duplicate identifier 'TaskEvent'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:363:6
Duplicate identifier 'TaskEvent'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:367:7
Duplicate identifier 'TaskState'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:368:6
Duplicate identifier 'TaskState'.
ERROR in [default] /Users/daslicht/DEV/exp/angular2-firebase/node_modules/firebase/firebase.d.ts:405:2
Duplicate identifier 'export='.
Version info
"@angular/common": "~2.1.0",
"@angular/compiler": "~2.1.0",
"@angular/core": "~2.1.0",
"@angular/forms": "~2.1.0",
"@angular/http": "~2.1.0",
"@angular/platform-browser": "~2.1.0",
"@angular/platform-browser-dynamic": "~2.1.0",
"@angular/router": "~3.1.0",
"angularfire2": "^2.0.0-beta.6",
"core-js": "^2.4.1",
"firebase": "^3.5.2",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
see: https://github.com/daslicht/angular2-firebase/blob/slideshow/package.json#L14
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 22 (6 by maintainers)
Hi @daslicht, as mentioned in the change log, you have to remove the firebase typings from the tsconfig. I’ve received the same errors, but removing firebase from the tsconfig.json solved the problem.
Note from the change log:
My solution was to install the same version as needed by angularfire2:
I was facing the same problem.
I followed this steps:
Now everything is working good! Thanks all!
@katowulf The issue only shows if you import firebase somewhere.
I use some of the regular firebase functionality in my application, and need to
import * as firebase from 'firebase';
(in order to have access to the firebase object).It’s because angularfire2 installs it’s own version of firebase (or because of me installing my own version of firebase, same issue). If firebase was a peerDependency, none of this would happen.
Related: https://github.com/angular/angularfire2/issues/623
Solutions:
firebase@3.5.3
(or any version later than3.3.0
) it’s possible to remove angularfire2’s firebase by runningrm -rf node_modules/angularfire2/node_modules/firebase
which also solves the problem.@davideast nope, I have not installed firebase types @AdamJo, I have also removed “firebase”: “^3.5.3” from the package.json, ran npm prune, ng build all is good.
Even though I was getting the console screaming bloody murder error messages, the app was compiling and working ( when I still had , “firebase”: “^3.5.3” on the package.json)
And by the looks of the inner content of angularfire2 beta 6 npm package (node_modules\angularfire2\node_modules\firebase\package.json) its using “firebase@3.3.0”, I guess in the near future we will see using the latest version
Cheerio edo@rdo
I had the same problem. Based to @davideast suggestion, I did
npm uninstall @types/firebase
. This solved the problem.Same here. I thought I was going crazy!
With npm install firebase@3.3.0 angularfire2 --save everything works ok. Thanks for the fix!!
@edoardoVD Have you installed Firebase types from
npm install @types/firebase
? Because that would provide duplicate typings as the npm package ships with the typings.If not try deleting your
node_modules
and re-installing.@dabele91 This is my guess as well. @daslicht Let me know if that works.
Hi @daslicht, can you please update your issue to follow the template? There are many fields missing that would be helpful.
Can you also provide your
tsconfig.json
?Getting the same errors when trying to upgrade to beta.6-preview.
Windows 10