react-native-reanimated: Can't find variable: _globalSetter in expo

Description

When I use react native reanimated v2 with expo I am getting some strange error.

Screenshots


ReferenceError: Can't find variable: _globalSetter
- node_modules\react-native\Libraries\LogBox\LogBox.js:148:8 in registerError
- node_modules\react-native\Libraries\LogBox\LogBox.js:59:8 in errorImpl
- node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in console.error
- node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
- node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException
- node_modules\react-native\Libraries\Core\ExceptionsManager.js:171:19 in handleException
- node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError
- node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:9:32 in ErrorUtils.setGlobalHandler$argument_0
- node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
- node_modules\regenerator-runtime\runtime.js:293:29 in invoke
- node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
- node_modules\regenerator-runtime\runtime.js:154:27 in invoke
- node_modules\regenerator-runtime\runtime.js:164:18 in PromiseImpl.resolve.then$argument_0
- node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne
- node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

Steps To Reproduce

I followed this docs to add reanimated with my expo app. https://docs.expo.io/versions/latest/sdk/reanimated/

  • “react”: “16.13.1”,
  • “react-native-gesture-handler”: “^1.9.0”,
  • “react-native-reanimated”: “2.0.0-rc.0”,
  • “react-native-redash”: “^16.0.5”,
  • NodeJS: v12.18.2

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

Got the same issues. What was the fix? Tried everything in here, nothing works.

EDIT: So i did the following to solve my issue.

I did everything mentioned here: https://docs.expo.io/versions/latest/sdk/reanimated/ Import is the babel.config!

Then i did: yarn add core-js@^3 yarn cache clean rm -r node_modules yarn expo start -c

Hey @adityakmr7 Can you check this solution and let me know if it works for you?

I have tried all of the different strategies listed and no luck. still the dreaded error. I have cleared things out probably 20 times over past 3 hours. Anyone??

did you ever find a solution I have the problem now cant find a solution