ERROR in node_modules/angularfire2/auth/auth.d.ts(10,20): error TS2503: Cannot find namespace 'firebase'.
See original GitHub issueAngular: 5.0
Firebase: 4.8.1
AngularFire: 5.0.0-rc.4
Other (e.g. Ionic/Cordova, Node, browser, operating system): no
How to reproduce these conditions
Steps to set up and reproduce
Follow the Installation & Setup guide in the agunlarfire 2 github
Sample data and security rules
<-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) -->
Debug output
** Errors in the JavaScript console **
** Output from firebase.database().enableLogging(true);
**
** Screenshots **
ERROR in node_modules/angularfire2/auth/auth.d.ts(10,20): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/auth/auth.d.ts(11,36): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firebase.app.module.d.ts(5,45): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firebase.app.module.d.ts(8,17): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firebase.app.module.d.ts(9,21): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firebase.app.module.d.ts(10,22): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firebase.app.module.d.ts(11,20): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firebase.app.module.d.ts(13,22): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/changes.d.ts(8,43): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/changes.d.ts(9,46): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/changes.d.ts(9,80): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/changes.d.ts(10,49): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/changes.d.ts(10,95): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/changes.d.ts(10,140): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/changes.d.ts(10,182): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/changes.d.ts(11,49): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/changes.d.ts(11,94): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/changes.d.ts(11,130): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/collection.d.ts(8,54): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/collection.d.ts(8,96): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/collection.d.ts(10,19): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/collection.d.ts(12,22): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/collection.d.ts(12,69): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/collection.d.ts(13,27): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/collection.d.ts(14,25): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/collection.d.ts(15,30): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/collection.d.ts(16,27): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/collection/collection.d.ts(17,27): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/document/document.d.ts(8,10): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/document/document.d.ts(9,22): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/document/document.d.ts(10,28): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/document/document.d.ts(14,42): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/firestore.d.ts(9,55): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/firestore.d.ts(12,25): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/interfaces.d.ts(4,11): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/interfaces.d.ts(5,14): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/interfaces.d.ts(14,37): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/interfaces.d.ts(14,80): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/interfaces.d.ts(16,10): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/interfaces.d.ts(17,12): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/observable/fromRef.d.ts(6,41): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/observable/fromRef.d.ts(6,80): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/observable/fromRef.d.ts(7,41): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/observable/fromRef.d.ts(7,98): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/observable/fromRef.d.ts(8,48): error TS2503: Cannot find namespace ‘firebase’. node_modules/angularfire2/firestore/observable/fromRef.d.ts(8,93): error TS2503: Cannot find namespace ‘firebase’.
Expected behavior
Project compiles successfully
Actual behavior
The project doesn’t compile
Issue Analytics
- State:
- Created 6 years ago
- Reactions:35
- Comments:89 (13 by maintainers)
@rts-cwalker The same happened to me.
Changing it to firebase 4.8.0 fixed the issue as stated in the other thread.
Solution:
1. Inside
package.json
, remove^
from"firebase": "^4.8.1"
1.1 Downgrade Firebase from 4.8.1 to 4.8.0 by changing4.8.1
to4.8.0
1.2 End result should look like this:"firebase": "4.8.0"
2. Runnpm update
in the Project Root. NPM will downgrade Firebase for ya 3. Runng serve --open
to check for compilation errors. There shouldn’t be any. 4. Enjoy!Reason:
Firebase had introduced some breaking changes that AngularFire2 had not coped up with yet. Until the AngularFire2 team work it out, this will be the solution.
Add a thumbs up emoji and direct anyone having the same trouble here! Would save a lot of their time!