FileReader.readAsDataURL() stops working after migrate Expo 31


#1

Hi,
in my code I was fetching an Image and converting it to base64.

Basically I am using this piece of code:

 const reader = new FileReader()
        reader.readAsDataURL(response)
        reader.onloadend = function() {
          const base64data = reader.result
          console.log('--', base64data)
          resolve(base64data)
        }

This conversion was working perfectly before migrating Expo 31, now the result is always something like

-- data:application/octet-stream;base64,77+9UE5HDQoaCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... (thousands of As)

Do someone know what could be happening?

Thanks!


#2

Hey @ivan-travelperk,

I haven’t seen any other reports of this. Is this occurring on both platforms? If it’s just happening on Android, it may be related to the recent JSC upgrade that was part of the SDK31 release.

Cheers,

Adam


#3

for the moment I’ve found it in Android, specifically the error is in react-native/Libraries/Blob/FileReader readAsDataURL then it seems more related to react-native than Expo.

I also found an open issue for react-native


#4

Ah, I clearly didn’t do a thorough enough search of RN’s issues. I would follow along at the issue you linked since as you stated it’s more in the realm of RN than Expo. Hope it gets resolved soon!