title: Firestore Query Raises Exception if Including orderBy
body: <p>I have the following function:</p>
  <pre><code>async function loadGalleryImages2() { // load images for gallery
      const collectionRef = db.collection('projects').doc(project.id).collection('images')
      const docQuery = query(collectionRef, orderBy('displayOrder'))
  }
  </code></pre>
  <p>where the declaration of <code>docQuery</code> causes the following error to appear in console:</p>
  <blockquote>
  <p>Uncaught (in promise) TypeError: Cannot read properties of undefined
  (reading 'startAt')</p>
  </blockquote>
  <p>If I remove the <code>orderBy</code> parameter as shown below, I do not get any error.</p>
  <pre><code>async function loadGalleryImages2() { // load images for gallery
      const collectionRef = db.collection('projects').doc(project.id).collection('images')
      const docQuery = query(collectionRef)
  }
  </code></pre>
  <p>The firebase docs show <a href="https://firebase.google.com/docs/firestore/query-data/order-limit-data" rel="nofollow noreferrer">similar examples</a> so I'm not sure why this is causing errors.</p>