title: FirebaseError: Function CollectionReference.doc() cannot be called with an empty path
body: <p>I am getting a list of id's from users collection then when I am trying to get by id data from another collection anunturi this error:</p>
  <blockquote>
  <p>FirebaseError: Function CollectionReference.doc() cannot be called with an empty path</p>
  </blockquote>
  <pre><code>&lt;script&gt;
  import { db } from &quot;../Utils/fire.js&quot;
  import { current_user } from &quot;../Utils/auth.js&quot;
  import Room from &quot;./Room.svelte&quot;
  
  async function interestedForUser(){
      let query = await db.collection(&quot;users&quot;).doc($current_user.uid).get()
      const listingsIds = await query.data().anunturi_interesat 
      console.log(listingsIds) //ok
      let anunturi = []
      for (let id of listingsIds) {
          console.log(id, typeof(id)) // ok
          let anunt = await db.collection(&quot;anunturi&quot;).doc(id).get() // nok
          let anunt_data = await anunt.data() 
          if (anunt_data) {
              anunturi.push({...anunt_data, listingId:id})
          } 
      }
      return anunturi
  }
  
  &lt;/script&gt;
  
  {#await interestedForUser()}
      &lt;p class=&quot;text-center mt-12&quot;&gt;Se incarca...&lt;/p&gt;
  {:then listings}
      {console.log(&quot;In template:&quot;, listings, listings.length)} //ok (but why?)
      {#if listings.length &gt; 0} // this doesn't get rendered..
          {#each listings as camera }
              &lt;Room {camera}/&gt;
          {/each}
      {:else}
          &lt;p class=&quot;text-center mt-12&quot;&gt;Nu ai postat nici un anunt&lt;/p&gt;
      {/if}
  {:catch error}
      &lt;p style=&quot;color: red&quot;&gt;{error.message}&lt;/p&gt;
  {/await}
  </code></pre>
  <p><a href="https://i.stack.imgur.com/R9Cx0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R9Cx0.png" alt="console error" /></a></p>
  <p><strong>UPDATE:</strong></p>
  <p>The issue was in the <code>&lt;Room {camera}/&gt;</code> component. A child of <code>Room</code> component had a firestore reference undefined.</p>