vision-camera-code-scanner icon indicating copy to clipboard operation
vision-camera-code-scanner copied to clipboard

Latest RN 0.69 on iOS: (0,_.scanBarcodes) is not a function

Open netzwerg opened this issue 2 years ago • 13 comments

Using the latest RN 0.69, I get the following error on iOS:

Frame Processor threw an error: (0,_.scanBarcodes) is not a function. (In '(0,_.scanBarcodes)(frame,types,options)', '(0,_.scanBarcodes)' is undefined)
In: _f@/Users/xxx/node_modules/vision-camera-code-scanner/lib/commonjs/hook.js (18:73):1:137
    @[native code]
    _f@/Users/xxx/node_modules/react-native-vision-camera/lib/commonjs/hooks/useFrameProcessor.js (31:33):1:425
    @[native code]

package.json

"react-native-reanimated": "^2.8.0",
"react-native-vision-camera": "^2.13.5",
"vision-camera-code-scanner": "^0.2.0"

I get the same error if I don't use the useScanBarcodes hook, but invoke useFrameProcessor myself:

const frameProcessor = useFrameProcessor((frame) => {
    'worklet';
    const detectedBarcodes = scanBarcodes(frame, types, options);
    runOnJS(setBarcodes)(detectedBarcodes);
  }, []);

netzwerg avatar Jun 29 '22 06:06 netzwerg