I have upgraded the firebase JS SDK from v7 to v8.0.0 and I am importing firebase like so.
import * as firebase from 'firebase';
Accessing any of the following causes the error below.
firebase.firestore.FieldValue.serverTimestamp()
firebase.User
firebase.auth.UserCredential
export 'firestore' (imported as 'firebase') was not found in 'firebase' Property 'firestore' does not exist on type 'typeof import("appPath/node_modules/firebase/index")'
I have found a workaround by changing firebase to firebase.default e.g.
firebase.default.firestore.FieldValue.serverTimestamp()
Is this the correct approach to resolve this?
EDIT: I am also using AngularFire in the project. I tried using:
import firebase from 'firebase/app';
import 'firebase/firestore';
export const firestore = firebase.firestore();
But this gave me the following error:
Uncaught FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).