title: Why is this error Function Query.where() called with invalid data. Unsupported field value: undefined happening in firebase?
body: <p>I'm trying to get a specific doc from my firestore database. So I matched the <code>slug</code> field in the doc. But it throws me an error...</p>
  <blockquote>
  <p>Function Query.where() called with invalid data. Unsupported field value: undefined</p>
  </blockquote>
  <p>My syntax looks like this</p>
  <pre><code>export async function getStaticProps(context) {
    const { slug } = context.params;
  
    const res = await firebase
      .firestore()
      .collection(&quot;books&quot;)
      .where(&quot;slug&quot;, &quot;==&quot;, slug)
      .get();
  
    const book = res.docs.map((book) =&gt; book.data());
  
    if (book.length) {
      return {
        props: {
          book: book[0],
        },
      };
    } else {
      return {
        props: {},
      };
    }
  }
  
  </code></pre>
  <p>and my firestore document looks like</p>
  <p><a href="https://i.stack.imgur.com/8Ekbe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Ekbe.png" alt="enter image description here" /></a></p>
  <p>BTW I'm using Next.Js's SSG.</p>