callstack / react-native-image-editor

A library providing an API for cropping images from the web and the local file system.
MIT License
376 stars 118 forks source link

Getting error : "undefined is not a function (evaluating 'Object.keys(styles)[typof Symbol === "function"? Symbol.iterator : @@iterator"]()')" #23

Closed renishdeveloper closed 5 years ago

renishdeveloper commented 5 years ago

I am using the cropImage from https://github.com/react-native-community/react-native-image-editor/issues/new. Description : Project created using react-native init

react-native info

React Native Environment Info: System: OS: Linux 4.15 Ubuntu 18.04.2 LTS (Bionic Beaver) CPU: (6) x64 AMD FX(tm)-6300 Six-Core Processor Memory: 405.62 MB / 3.59 GB Shell: 4.4.19 Binaries: Node: 8.16.0 npm: 6.4.1 npmPackages: react: 16.6.3 => 16.6.3 react-native: 0.58.3 => 0.58.3 npmGlobalPackages: react-native-cli: 2.0.1 Code : _cropImage = async () => {

let resizedUri = await new Promise((resolve, reject) => {
  ImageEditor.cropImage(this.state.image,
    {
      offset: { x: 0, y: 0 },
      size: { width: 100, height: 100 },
      displaySize: { width: 100, height: 100 },
      resizeMode: 'contain',
    },
    (uri) => resolve(uri),
    () => reject(),
  );
});
Trancever commented 5 years ago

@renishdeveloper Do you still have an issue? Can you provide repo that reproduces it?

guhungry commented 5 years ago

@renishdeveloper My hunch is that babel transform doesn't apply. I don't think it's specific to this library.

Try

  1. Run react-native start before react-native run-android
  2. Or, upgrade React Native to 0.59.8. Which should be fixed by newer https://github.com/react-native-community/cli and https://github.com/react-native-community/jsc-android-buildscripts
Trancever commented 5 years ago

@renishdeveloper This is probably not related to this library. I am closing this. Please reopen if you still have some questions.