Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6581

Expo SDK 52 react application: Method stuck when calling new Blob

$
0
0

I have an expo application where I receive an Uint8Array corresponding to an image which was serialized to bytes in kotlin native module and I want to convert this array to a blob so I can send it to an API endpoint via fetch with a POST request. When the event listener gets the object with the payload to send to the server, I noticed that the code wasn't getting executed. No exceptions appeared in the terminal nor in adb logcat.

Before trying to create a blob object from the Uint8Array, I was getting a base64 encoded image, however it caused oom after a few minutes of having the app running. So I need to work with the bytes directly.

Just to test what was happening, I replaced the new Blob(...) with a fixed array instead of using the payload coming into the event listener.

Something like this:

const b = new Blob([new Uint8Array([1, 2, 3, 4, 5, 6]).buffer]);console.log("Blob created");

And application stops there. If I remove that line where the Blob is created, then the log message below is displayed. Is there anything I'm missing when creating the blob. No errors are displayed... I am kind of lost.

NOTE: Same thing happens if .buffer is omitted in the creation of new Blob object. Also, this occurs when running on the android emulator.


Viewing all articles
Browse latest Browse all 6581

Latest Images

Trending Articles



Latest Images