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

__scanCodes is not defined

Open Pietro-Putelli opened this issue 2 years ago • 4 comments

Hi, I'm getting the following error, as a lot of other people report on issues.

__scanCodes is not defined

It occurs both on iOS and Android.

Here's my libraries version:

"react-native": "^0.70.6",
"react-native-vision-camera": "2.9.4",
"vision-camera-code-scanner": "^0.2.0",
"react-native-reanimated": "^2.13.0",

And finally the babel.config.js

module.exports = {
  presets: ["module:metro-react-native-babel-preset"],
  plugins: [
    ["react-native-reanimated/plugin", { globals: ["__scanCodes"] }],
    "module:react-native-dotenv",
  ],
};

I have also tried to patch react-native-vision-camera, following this instructions: https://github.com/rodgomesc/vision-camera-code-scanner/issues/79#issuecomment-1278937809

Update, the following error occurs while trying to install CocoaPods:

Screenshot 2023-01-04 at 4 52 05 PM

Does someone have a solution for this issue? Or does a patch exist to solve the problem? Thank you

Pietro-Putelli avatar Jan 04 '23 12:01 Pietro-Putelli

it also happen to me. idk how to fix this.

hematenergi avatar Jan 26 '23 09:01 hematenergi

@hematenergi @Pietro-Putelli try to import react-native-gesture-handler in top level of index.js file

Salem-Abderaouf avatar Mar 20 '23 13:03 Salem-Abderaouf

try yarn start --resetCache

navaspavil avatar Mar 27 '23 09:03 navaspavil

yarn start --reset-cache solved the issue in my case.

ulexxander avatar Jun 20 '23 19:06 ulexxander