This error occurs when I run the following code in React Native to convert base64 to blob on Android
let url = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA...';
let res = await fetch(url);
let blob = await res?.blob();

If you want to convert Base64 to blob you can use the following way :
Install the package below
npm install buffer --save
First, convert your Base64 to the array of bytes
import { Buffer } from "buffer";
const base64 = 'iVBORw0KGgoAAAANSUhEU ....'
let your_bytes = Buffer.from(base64, "base64");
Then convert it to blob:
const blob = new Blob([your_bytes], { type: 'YOUR TYPE' })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With