react-native-vision-camera: ERROR ReferenceError: Property '_setGlobalConsole' doesn't exist

Question

I am facing a error that error says ERROR ReferenceError: Property ‘_setGlobalConsole’ doesn’t exist any idea how can i fix this issue with react-native-vision-camera?

What I tried

 "dependencies": {
    "@react-native-async-storage/async-storage": "^1.17.11",
    "@react-navigation/native": "^6.1.6",
    "@react-navigation/native-stack": "^6.9.12",
    "firebase": "^9.17.2",
    "react": "18.2.0",
    "react-native": "0.71.3",
    "react-native-gesture-handler": "^2.9.0",
    "react-native-image-crop-picker": "^0.39.0",
    "react-native-onboarding-swiper": "^1.2.0",
    "react-native-reanimated": "^3.0.1",
    "react-native-safe-area-context": "^4.5.0",
    "react-native-screens": "^3.20.0",
    "react-native-vector-icons": "^9.2.0",
    "react-native-vision-camera": "^2.15.4",
    "vision-camera-face-detector": "^0.1.8"
  },

VisionCamera Version

2.15.4

Additional information

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 11
  • Comments: 38 (1 by maintainers)

Most upvoted comments

using react-native-reanimated version 2.14.4 fixed my issue

Thanks, @syblus446 - I can confirm that it is working with react-native-reanimated@2.14.4.

It’s work for me after ‘npx react-native start --reset-cache’

    "react": "17.0.2",
    "react-native": "0.68.2",
    "react-native-reanimated": "2.14.4",
    "react-native-vision-camera": "2.15.4",
    "vision-camera-code-scanner": "0.2.0"

same issue

@GaylordP import ‘react-native-reanimated’ to the top of the file when using useFrameProcessor. Fixed my issue

using react-native-reanimated version 2.14.4 fixed my issue

From our investigation, useFrameProcessor hook uses _setGlobalConsole global method from react-native-reanimated library, but it was removed in the latest version (3.0.2) of react-native-reanimated.

https://github.com/mrousavy/react-native-vision-camera/issues/1210#issuecomment-1457776475

vision-camera V2 only works with reanimated v2. On vision-camera v3 it will not use reanimated anymore and the incompatibility will be resolved. So until the release we should use reanimated v2

@mrousavy I have the same issue with my project.

Please anyone help with this? Thank you in advance.

"react": "18.2.0", "react-native": "0.72.3", "react-native-reanimated": "3.0.2" "react-native-vision-camera": "^2.15.4",

I was also facing this issue but it resolved with below step: step1: I downgraded “react-native-reanimated”: “^3.1.0” to “react-native-reanimated”: “2.14.4”. step2: Added import 'react-native-reanimated' in index.js which is our entry file. step3: yarn start --reset-cache After above step run your project. It should run without any issue. My packages details: “react”: “18.2.0”, “react-native”: “0.71.3”, “react-native-reanimated”: “2.14.4”, “react-native-vision-camera”: “2.15.4”, “vision-camera-code-scanner”: “0.2.0”

A PR is underway on this subject :

https://github.com/mrousavy/react-native-vision-camera/pull/1623

(But no release date 😕 )

@mrousavy I have the same situation,and I got a location on the relevant file:node_modules\react-native-vision-camera\src\hooks\useFrameProcessor.ts
image but when I comment out this line of code,the program will throw an error and crashes
image I don’t know how to solve it

On react native v0.72, the downgrade to 2.14.4, is not working. 😦 For a quick fix, I have made a change in node_module react -native-vision-camera the below changes.

  1. go to node_modules->react-native-vision-camera->src->hooks->useFrameProcessor.ts
  2. comment the code _setGlobalConsole(console);
  3. restart the metro with reset cache. react-native start --reset-cache

Its just a quick fix. Everytime run yarn command, it will be replaced. For persistant change, please apply patch-package https://www.npmjs.com/package/patch-package

On react native v0.72, the downgrade to 2.14.4, is not working. 😦 For a quick fix, I have made a change in node_module react -native-vision-camera the below changes.

  1. go to node_modules->react-native-vision-camera->src->hooks->useFrameProcessor.ts
  2. comment the code _setGlobalConsole(console);
  3. restart the metro with reset cache. react-native start --reset-cache

Its just a quick fix. Everytime run yarn command, it will be replaced. For persistant change, please apply patch-package https://www.npmjs.com/package/patch-package


I got an error : ERROR frame-processor/unavailable: Frame Processors are not enabled. See https://react-native-vision-camera.com/docs/guides/troubleshooting, js engine: hermes

Thanks a lot. Everything ok.

I’m trying to downgrade using react-native-reanimated@2.14.4 but my app crashes

Btw i use:

"react-native": "0.71.4",
"react": "18.2.0",

using react-native-reanimated version 2.14.4 fixed my issue

Thanks, @syblus446 - I can confirm that it is working with react-native-reanimated@2.14.4.