question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR in node_modules/angularfire2/auth/auth.d.ts(10,20): error TS2503: Cannot find namespace 'firebase'.

See original GitHub issue

Angular: 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:closed
  • Created 6 years ago
  • Reactions:35
  • Comments:89 (13 by maintainers)

github_iconTop GitHub Comments

35reactions
a-cordoba10commented, Dec 19, 2017

@rts-cwalker The same happened to me.

Changing it to firebase 4.8.0 fixed the issue as stated in the other thread.

26reactions
Etosticitycommented, Dec 24, 2017

Solution:

1. Inside package.json, remove ^ from "firebase": "^4.8.1" 1.1 Downgrade Firebase from 4.8.1 to 4.8.0 by changing 4.8.1 to 4.8.0 1.2 End result should look like this: "firebase": "4.8.0" 2. Run npm update in the Project Root. NPM will downgrade Firebase for ya 3. Run ng 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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript error:Error TS2503: Cannot find namespace 'firebase'
In tsconfig under compilerSettings, add the property "types" and specify "firebase" as a type: { "compilerOptions": { "allowSyntheticDefaultImports": true ...
Read more >
cannot find namespace 'firebase' - Google Groups
node_modules/angularfire2/auth/auth.d.ts(10,20): error TS2503: Cannot find namespace 'firebase'. ... error TS2503: Cannot find namespace 'database'.
Read more >
Cannot find namespace 'firebase' - ionic-v3
When I run ionic serve , I get the following error: Typescript Error Cannot find namespace 'firebase'. ...t/IDE/ionic-apps/theWhoZoo-chat ...
Read more >
firebase::auth Namespace
Indicates that the iOS bundle ID is missing when an iOS App Store ID is provided. Note:This error is iOS-specific. kAuthErrorMissingMultiFactorInfo.
Read more >
cannot find namespace 'firebase' - DarkEdges
cannot find namespace 'firebase'. Sep 8, 2016 • nirving • Category: Angular Firebase. I was having this issue after trying to follow the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found