David Haddad
David Haddad

Reputation: 3926

Namespace 'firebase' has no exported member 'firestore'

Just started using AngularFire2 v5 seeing the following error about a dozen times when I run the app: Namespace 'firebase' has no exported member 'firestore' in the following .d.ts files:

node_modules/angularfire2/firebase.app.module.d.ts
node_modules/angularfire2/firestore/collection/changes.d.ts
node_modules/angularfire2/firestore/firestore.d.ts
node_modules/angularfire2/firestore/interfaces.d.ts
node_modules/angularfire2/firestore/observable/fromRef.d.ts

I'm on "angularfire2": "^5.0.0-rc.3".

Upvotes: 9

Views: 13746

Answers (4)

Vikram Kumar
Vikram Kumar

Reputation: 547

Import firebase correctly as follows:

import firebase from 'firebase/app';

then try using something like:

firebase.firestore.OrderByDirection

Upvotes: 0

Sophie C Musical
Sophie C Musical

Reputation: 76

Also working with npm i --save firebase@latest then you have latest version.

Upvotes: 1

jithin john
jithin john

Reputation: 572

I had the same issue. I was having firebase version 4.4.0 . Then i upgraded to 4.5.0
npm i --save firebase@^4.5.0

Now its working fine for me.

Upvotes: 6

DarkNeuron
DarkNeuron

Reputation: 8692

Double check your version of angularfire2. It downgrades to RC0 if you do an npm update, which I've noticed from their issue tracker is cause for a big amount of grief.

Upvotes: 1

Related Questions