title: Firestore finds undefined value in fully defined JSON, key does not even exist
body: <p>I am trying to upload a JSON-object to Google Firestore.</p>
  
  <p>When setting the Object to a Firestore Document my code throws the following Error:</p>
  
  <pre><code>Error: Value for argument "data" is not a valid Firestore document. 
  Cannot use "undefined" as a Firestore value 
  (found in field audit.`20`.requests.`0`.lrEndTimeDeltaMs).
  </code></pre>
  
  <p>Now the first thing I did was log the Object right before the upload to check for undefined values:</p>
  
  <pre><code>console.log(JSON.stringify(resultsToUpload));
  
  return database
    .collection("foo1")
    .doc("bar1")
    .set(resultsToUpload);
  </code></pre>
  
  <p>Not only are all values defined in the object, but the mentioned field <code>audit.`20`.requests.`0`.lrEndTimeDeltaMs</code> does not even exist:</p>
  
  <pre><code>resultsToUpload = {  
    "audit":{   
      "20":{  
        "ronaldScore":3,
        "id":"network-requests",
        "requests":[  
          {  
            "url":"https://www.example.com/",
            "startTime":0,
            "endTime":62.16699999640696,
            "transferSize":15794,
            "resourceSize":78243,
            "statusCode":200,
            "mimeType":"text/html",
            "resourceType":"Document"
          }
        ]
      }
    }
  }
  </code></pre>
  
  <p>The data comes from a Google Lighthouse Audit.</p>
  
  <p>Calculating the UTF-8 string length of the stringified JSON objects results in a size of 30 MB.</p>
  
  <p>1) All values are defined (some are null, which should not be a problem).</p>
  
  <p>2) The mentioned field does not even exist in the JSON.</p>
  
  <p>My question is: How can this happen? How can a field just appear?
  Also: How would I fix this issue?</p>