Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resp.text() cause exception Property 'base64' doesn't not exits #126

Closed
zhuanghongji opened this issue Mar 2, 2022 · 2 comments
Closed

Comments

@zhuanghongji
Copy link

react-native-blob-util: ^0.14.1

example code:

export async function test() {
   try {
      const resp = await RNFetchBlob.fetch('GET', 'a-url')  
      const text = await resp.text()     // the line caused exception
   } catch(e) {
      console.log(e.message)            // Property 'base64' doesn't not exits
   }
}

If i goto /node_modules/react-native-blob-util/class/ReactNativeBlobUtilBlobResponse.js and add code below:

import base64 from 'base-64'

resp.text() worked.

So, is any wrong with text() implement ?

note: if it switch to 'rn-fetch-blob' and try the same example code, text() work fine.

@jaylensoeur
Copy link

I have the same problem, it looks like the dependency is missing.

@RonRadtke
Copy link
Owner

Thanks, I merged your PR @jaylensoeur

RonRadtke pushed a commit that referenced this issue Mar 25, 2022
* Transform for read and write methods (e.g. for encryption)

fixes #92
fixes #126
fixes #131
fixes #120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants