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

What is my error? TypeError: null is not an object #22

Open
ved08 opened this issue Sep 21, 2020 · 5 comments
Open

What is my error? TypeError: null is not an object #22

ved08 opened this issue Sep 21, 2020 · 5 comments

Comments

@ved08
Copy link

ved08 commented Sep 21, 2020

This is my code:

import ImgToBase64 from 'react-native-image-base64';
sendData = async (uri) => {
  ImgToBase64.getBase64String(uri)
      .then(base64String => {
        console.log(base64String)
      })
      .catch(err => console.log("Error Occured", err));
}

someFunction = async () => {
...function content...
this.sendData(result.uri) //here result.uri is the path to that image i.e file://...
}

With this, I am getting an error saying "TypeError: null is not an object".
Please solve my error
Thanks!

@dylancl
Copy link

dylancl commented Jan 20, 2022

Same

@0x1h
Copy link

0x1h commented Apr 30, 2022

same error

React-native: v0.64.3
react-native-image-base64: v0.1.4
expo: ~44.0.0

[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNativeImageBase.default.getBase64String')]

@iamtheretronerd
Copy link

same
any solution ?

@0x1h
Copy link

0x1h commented May 7, 2022

@iamtheretronerd I didn't find any solution for react-native-image-base64 but you can use expo-file-system

import * as FileSystem from 'expo-file-system';

const getBase64 = async (path) => {
   await FileSystem.readAsStringAsync(path, { encoding: 'base64' })
    .then(base64 => console.log(base44))
    .catch(err => console.log(err))
}

@BekaBerua
Copy link

BekaBerua commented May 7, 2022

this guy is fucking right trust him ( in my opinion )

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

5 participants