title: React Unhandled Rejection (TypeError): Cannot read property '_internalPath' of undefined
body: <p>I've been trying to get firebase working with react, and got this error</p>
  <pre><code>import React, { useState, useEffect } from 'react'
  import firebase from 'firebase/app'
  import 'firebase/firestore'
  
  export default function CoursesPage(){
      const [courses, setCourses] = useState(&lt;p&gt;Loading courses...&lt;/p&gt;)
      useEffect(() =&gt; {
          async function fetch(){
              const db = firebase.firestore()
              const myAuthLevel = (firebase.auth().currentUser != null) ? await (await db.collection('users').doc(firebase.auth().currentUser.uid).get()).data().authLevel : 0
              console.log(myAuthLevel)
              const courses = await db.collection(&quot;courses&quot;).where(myAuthLevel, '&gt;=', 'authLevel').get()// orderBy('createdAt').get()
              console.log(courses)
          }
          fetch()
      },[])
  
      return(
          &lt;page&gt;
              &lt;h1&gt;Courses&lt;/h1&gt;
              {courses}
          &lt;/page&gt;
      )
  }
  </code></pre>
  <blockquote>
  <p>Unhandled Rejection (TypeError): Cannot read property '_internalPath' of undefined
  fetch
  D:/Peti/Programming/node/coursewebpage/src/components/CoursesPage.js:12
  9 |     const db = firebase.firestore()
  10 |     const myAuthLevel = (firebase.auth().currentUser != null) ? await (await db.collection('users').doc(firebase.auth().currentUser.uid).get()).data().authLevel : 0
  11 |     console.log(myAuthLevel)
  12 |     const courses = await db.collection(&quot;courses&quot;).where(myAuthLevel, '&gt;=', 'authLevel').get()// orderBy('createdAt').get()
  | ^  13 |     console.log(courses)
  14 | }
  15 | //const courses = await getFirebase().firestore().collection('courses').get()</p>
  </blockquote>