JS convert blob url to Base64 file
<p>There is the following code:</p>

<pre><code>console.log(blob);
var reader = new window.FileReader();
reader.onloadend = function() {            
  console.log(reader.result);
};
reader.readAsDataURL(blob);
</code></pre>

<p>blob is '<code>blob:http://localhost:3000/e3c23a22-75b1-4b83-b39a-75104d1909b9</code>' and I've got the following error:</p>

<pre><code>TypeError: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'.
</code></pre>

<p>How can I fix this error and convert Blob to Base64 encoded image? Thanks in advance!</p>