jonathanpalma / react-native-tesseract-ocr

Tesseract OCR wrapper for React Native
MIT License
565 stars 172 forks source link

Undefined is not a function #39

Closed vitor504 closed 6 years ago

vitor504 commented 6 years ago

Hi,

I am trying to implement this in a project I am doing and I can't run it. It always shows me this error:

screenshot_20180322-143702

I did all the steps you specified to use this but I can't seem to be able to get this to work.

Hope you can help and thanks in advance.

jonathanpalma commented 6 years ago

@vitor504 Could you please provide some code of your implementation?

vitor504 commented 6 years ago

I have this in my main file:

RNTesseractOcr.recognize(source, 'LANG_ENGLISH', tessOptions) .then((result) => { this.setState({ ocrResult: result }); console.log("OCR Result: ", result); }) .catch((err) => { console.log("OCR Error: ", err); }) .done( this.setState({ textImg: result }) ); And when I put my mouse over the recognize method, it shows me a warning that it is an unresolved function or method.

It just does not seem to recognize the module.

vitor504 commented 6 years ago

I just created a simple project and executed all the steps you specified to make this work on my project but I just dont know if I am missing a file or something like that.

The import line just gives me a warning saying that it is a unused import and binding

import RNTesseractOcr from 'react-native-tesseract-ocr';