title: How to fix "Cannot read property 'firestore' of null" in Firestore
body: <p>I will try to change the setting in the function of firestore() but doesn't work.
  I read the document and they said that this future will be removed in a future release but I don't seen the solve. So I hope anyone can help me settle this problem</p>
  
  <p>Operating System version: Majove 10.14.2
  Library version: ^6.1.0
  Firebase Product: firestore</p>
  
  <pre><code>import * as firebase from 'firebase/app'
  import 'firebase/firestore'
  require('dotenv').config({ encoding: 'utf8' })
  
  const firebaseConfig = {
    apiKey: process.env.API_KEY,
    authDomain: process.env.AUTH_DOMAIN,
    databaseURL: process.env.DATABASE_URL,
    projectId: process.env.PROJECT_ID,
    storageBucket: process.env.STORAGE_BUCKET,
    messagingSenderId: process.env.MESSAGING_SENDER_ID,
    appId: process.env.APP_ID
  }
  
  // Initialize Firebase
  let firebaseApp = null
  if (!firebase.app.length) {
    firebaseApp = firebase.initializeApp(firebaseConfig)
  }
  firebaseApp.firestore().settings({
    ssl: false,
    timestampsInSnapshots: true
  })
  
  export default firebaseApp.firestore()
  </code></pre>