My project suddenly started to fail when attempting to OCR vision camera frames. It threw Frame Processor threw an error: Cannot read property 'result' of undefined... my code (removed all not related code to the issue):
import 'react-native-reanimated';
import {runOnJS} from 'react-native-reanimated';
import {scanOCR} from 'vision-camera-ocr';
import {
Camera,
useCameraDevices,
useFrameProcessor,
} from 'react-native-vision-camera';
const frameProcessor = useFrameProcessor(frame => {
'worklet';
const result = scanOCR(frame).result;
if (result.text.length > 0) {
runOnJS(processText)(result.text);
}
}, []);
scanOCR(frame) is returning undefined instead of a OCR result... the weird thing is i haven't changed my code at all from when it was working.
Hi @rodgomesc,
My project suddenly started to fail when attempting to OCR vision camera frames. It threw
Frame Processor threw an error: Cannot read property 'result' of undefined
... my code (removed all not related code to the issue):scanOCR(frame) is returning
undefined
instead of a OCR result... the weird thing is i haven't changed my code at all from when it was working.my dependencies:
my babel.config.js:
if you need the complete component code let me know.
Thanks for the awesome library!