title: How to solve the error message: Type 'unknown' is not assignable to type 'BlobPart'
body: <p>I have the following function call</p>
  <pre><code>this.component.getXML({ format: true }, (error, currentXML) =&gt; {
    if (error) {
      console.error(error.message);
    }
  
    // do something with currentXML
  });
  </code></pre>
  <p>But I want to use <code>async</code> <code>await</code> to solve a task, in order to do this I do the following</p>
  <pre><code>async function someName() {
    const promise = new Promise((resolve, reject) =&gt; {
      this.component.getXML({ format: true }, (error, currentXML) =&gt; {
        if (error) {
          reject(error);
        }
  
        resolve(currentXML);
      });
    });
  
    try {
      const currentXML = await promise;
  
      const blob = new Blob([currentXML], { type: &quot;text/xml&quot; });
      const formData = new FormData();
  
      formData.append(&quot;file&quot;, blob, &quot;filename.xml&quot;);
    } catch (error) {
      console.error(error.message);
    }
  }
  </code></pre>
  <p>This works. My problem is that when trying to build the blob <code>const blob = new Blob([currentXML], { type: &quot;text/xml&quot; });</code> it gives me this error message</p>
  <pre><code>Type 'unknown' is not assignable to type 'BlobPart'
  Type '{}' is missing the following properties from type 'Blob': size, type, arrayBuffer, slice, and 2 more.
  </code></pre>
  <p>The output of calling <code>const currentXML = await promise;</code> is a string, I have tried to define it explicitly but the error persists</p>
  <p>Thank you for your comment.</p>