-
Notifications
You must be signed in to change notification settings - Fork 222
ReferenceError: Can't find variable: __scanCodes #79
Comments
@FluffyDiscord have found any solution for this ? |
I had to switch to deprecated package |
I have the same issue and I am afraid the only solution is to switch back to react-native-camera. |
Same problem here Apple M1 |
Also had the same issue. I'm holding out until the rest of my app is complete but if no solution has been found by then, I'll be looking to switch to |
I am facing same issue... any fix?
|
我解决了,流程如下 |
I followed your instructions but still encounter the same issue with 0.69.1. Do you have an minimal working example you could share?
|
Facing same issue. Please fix. |
Is this a M1 thing? I have MacBook M1 as well and have the same error. Configuration: node v14.20.0
I tried this too, but no luck. |
It's not, I have a MacBook Intel one and I also have the same error |
+1 |
1 similar comment
+1 |
The same happens on ubuntu + android. So definitely not a Mac issue. |
Add this to your
Make sure to clear the metro cache after making this update. |
This doesn’t work in RN 0.69.X |
I am running 0.68.0. Will try upgrading to 0.69.X |
I believe a way to work when i disable the
|
This doesn’t work on RN 0.69.x |
It seems that /// This does not work
import { useScanBarcodes } from "vision-camera-code-scanner";
/// When you define it like this it works.
import {useState} from 'react'
import {runOnJS} from 'react-native-reanimated'
import {Frame, useFrameProcessor} from 'react-native-vision-camera'
import {Barcode, BarcodeFormat, CodeScannerOptions, scanBarcodes} from 'vision-camera-code-scanner'
export function useScanBarcodes(types: BarcodeFormat[], options?: CodeScannerOptions): [(frame: Frame) => void, Barcode[]] {
const [barcodes, setBarcodes] = useState<Barcode[]>([])
const frameProcessor = useFrameProcessor(frame => {
'worklet'
const detectedBarcodes = scanBarcodes(frame, types, options)
runOnJS(setBarcodes)(detectedBarcodes)
}, [])
return [frameProcessor, barcodes]
} |
What version of React Native are you using? |
@kierancrown RN 0.69.3 |
I seem to be missing something here, did you still add the globals to the babel.rc file? I'm getting this error
|
Yes I updated babel config as instructed and also at the top of the index.js file I added |
I've tried this and cannot get it to work. Do you by any chance have a minimal example? |
Having the same problem, seems like it's related to 0.69..x |
I have the same problem. Expo SDK 45. React Native 0.68.2 *Edit. I just used another development machine and everything works as it should. I initialized 2 projects using Expo SDK 45 and 46 (React Native 0.68.2 and 0.69.3) blank template, ejected, installed all dependencies according to the docs and everything worked. Except that there was an issue 1118 with RN 0.69.3 which is solved here. But besides that it just worked. So, either it was fixed or there is an issue with my other development machine, probably the Android Studio SDK manager is missing some SDK tools. *Edit 2. I am no longer able to replicate this issue on either of my machines (without any changes with SDK manager). I followed exactly the same procedures as yesterday when I got this error on every try. Today, no error, it just works. So ... I gues some of the libraries (vision-camera-code-scanner, react-native-vision-camera, react-native-reanimated) were fixed, or no idea. *Edit 3. I just remembered the one thing I changed - I updated Expo Go in my test device. |
Has anyone solved it yet? |
Facing the same issue. I've been looking for a solution for a day. |
I followed the installation steps, but it only seems to build on Android. Removing the package completely from my project allows me to build on iOS, otherwise I receive a bunch of errors - seemingly related to my M1 chip mac. package.json: babel.config.js: |
This library does not seem to work with I have not tried to use The other option is to upgrade |
in my case, i re-read the instructions, cleaned caches, ran the app again and it worked
the instructions changed 2 things :
then what i normally do in these cases
on android
on ios (just to make sure)
|
This saved me. Thank you. |
The iOS example from current main branch does still throw this error on iOS. Babel.config has scancodes in it and reanimated is imported in index.tsx. @rodgomesc Could you update the vision camera dependency to use the newest patched version please? |
Thanks, this worked - much appreciated! I believe the issue is not limited to the scanner but all Vision Camera plug-ins. I had it with a face detection plug-in and even with react-native-vision-camera v. 3 RC-2. (@mrousavy) Just to clarify for those not familiar with Java:
|
I got the same error message "__scanCodes is not defined". What helped in my case was to delete all subfolders of Xcodes derived folder. Then i deleted the "nodes_modules" folder. After that i run and at last i made a new build using xcode. |
"react-native-vision-camera": "2.15.6", I am facing the same issue ( Property '__scanCodes' doesn't exist ) in Xcode 15. |
Did you follow my solution from the post above? |
I am using "react-native-vision-camera": "2.16.2" which has the xcode 15 fix. |
I am also facing the same above issue? Any fix |
I have the same issue , ReanimatedError: Property '__scanCodes' doesn't exist. I upgrade to 2.16.2 due to possible issue with Iphone 15, so I did upgrade to the following. "react-native": "0.71.4", |
Is your |
same. |
same issue |
I plan to upgrade the package In fact, I have already replaced it, and the effect is very good at present. |
I also upgrade react-native-vision-camera to v3 and use integrated scanner all working good so far on both android and IOS. |
I am getting this error "ReferenceError: Can't find variable: __scanCodes" as well when upgrading to react-native-vision-camera 2.16.3. Have you been able to find a solution? I am not able to upgrade to v3 because it would impact a lot of my existing code |
I have resolved it by editing manually the FrameProcessor.h file |
Hi, which version are you using for React Native Vision Camera? Could you please show me the file and line that you have edited , Thanks |
If you find a fix please submit a PR. |
I am also facing same issue "ReferenceError: Property '__scanCodes' doesn't exist for some reason I cannot upgrade it to both reanimated and vision-camera to v3.Could someone help me out. react-native : 0.71.3 |
i am keeping the old version . new version does not work. |
VisionCamera V3 has a CodeScanner integrated. See: QR/Barcode Scanning. |
I think he edited FrameProcessorPlugin.h, I had to change it also to get rid of this error. |
No matter what I do I end up with this error and I am desperate.
Things I tried from other github issues
node_modules
react-native start --reset-cache
gradlew clean
react-native-reanimated
versions (2.4.1, 2.7.0, 2.8.0, 2.9.1)package.json
babel.config.js
entrypoint
index.js
The text was updated successfully, but these errors were encountered: