{"ok":false,"error":{"code":"TypeError","message":"d.stream is not a function"}}

Referring to nft.storage, I’m getting {"ok":false,"error":{"code":"TypeError","message":"d.stream is not a function"}} error. What does it mean?

It occurs in my code below when trying to upload.

      let files = new FormData(); 

      files.append("file", file);

      var url = "https://api.nft.storage/upload";

      var xhr = new XMLHttpRequest();
      xhr.open("POST", url);

      xhr.setRequestHeader(
        "Authorization",
        "Bearer " + nftStorageApiKey,
        "Content-Type",
        "application/x-www-form-urlencoded"
      );

      var ipfsResponse;

      xhr.onreadystatechange = function () {
        if (xhr.readyState === 4) {
          console.log(xhr.status);
          console.log(xhr.responseText);

          ipfsResponse = JSON.parse(xhr.responseText);
          console.log("CID: " + ipfsResponse.value.cid);
        }
      };

      xhr.send(files);

But if I change my code to the below, the error disappears but I get a different issue.

   xhr.setRequestHeader(
        "Authorization",
        "Bearer " + nftStorageApiKey
      );
 xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");