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

Created on 3 Jan 2021  路  11Comments  路  Source: software-mansion/react-native-reanimated

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
馃彔 Reanimated2 馃悶 Bug

Most helpful comment

@adityakmr7 @aca-hakan-pinar
Follow the guide and do not forget the babel plugin https://docs.expo.io/versions/latest/sdk/reanimated/

All 11 comments

Issue validator - update # 1

Hello!
It seems like there are some problems with your issue. Please fix them and wait for the validator to confirm that everything is alright.
Thank you!

Validator encountered the following problems:

  • Section required but not found: expected behavior(for label 馃悶 bug)
  • Section required but not found: actual behavior(for label 馃悶 bug)
  • Section required but not found: package versions(for label 馃悶 bug)

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

same issue
"expo": "^40.0.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.0.tar.gz",
"react-native-reanimated": "2.0.0-rc.0"
expo start -c not working
yarn cache clean not working

I tried cleaning cache not working , I even tried removing node_module and running yarn install again it still gives same error.

Same here

@adityakmr7 @aca-hakan-pinar
Follow the guide and do not forget the babel plugin https://docs.expo.io/versions/latest/sdk/reanimated/

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??

@ezos86 It worked for me when I follow the guide from scratch, step by step.
I was having the same issue, but sometimes you really have to go really slow on those guides and without skipping any step.

The key was babel plugging set up. Please make sure you are not missing that part and re-start everything if necessary, maybe cache, your machine or even the IOS simulator or everything in general fortunately there is no bug from this library!

@ezos86 It worked for me when I follow the guide from scratch, step by step.
I was having the same issue, but sometimes you really have to go really slow on those guides and without skipping any step.

The key was babel plugging set up. Please make sure you are not missing that part and re-start everything if necessary, maybe cache, your machine or even the IOS simulator or everything in general fortunately there is no bug from this library!

I restarted everything, went through the guide about 6 times from scratch. I have an expo app, that was exported, so started as expo, then ejected. Maybe that is issue, I don't know. But definitely not something i'm missing. Short of rewriting app from scratch. This is still an issue, I see some other reported bugs of same issue.

@ezos86 try with a brand new expo project, run the expo command that allows you to create a project from scratch. I have solved issues before with my team like this, they tried everything they could and still missing a little small detail and solved the issue in minutes instead of days. The best you can do on this situation is to try in a brand new expo project. Make it work and compare it with yours :)

Try this, bro npm install --save core-js@^3

It's worked for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wasim-abuzaher picture wasim-abuzaher  路  3Comments

jwhscholten picture jwhscholten  路  4Comments

dinhmai74 picture dinhmai74  路  3Comments

colinux picture colinux  路  3Comments

ArsalanCsquare picture ArsalanCsquare  路  3Comments