React-native-reanimated: ReferenceError: Can't find variable: _setGlobalConsole, after upgrading to `-rc.2`.

Created on 16 Jan 2021  路  18Comments  路  Source: software-mansion/react-native-reanimated

Description

getting the following error after upgrading to 2.0.0-rc.2 from 2.0.0-rc.1

Screenshots

Screen Shot 2021-01-16 at 1 34 20 AM

Steps To Reproduce

  • upgrade to rc.2
  • install the latest rc rc.2

Expected behavior

it should work as before.

Actual behavior

it throws an error ReferenceError: Can't find variable: _setGlobalConsole

Snack or minimal code example

N/A

Package versions

  • React: 16.13.1
  • React Native: 0.63.4
  • React Native Reanimated: ^2.0.0-rc.2
  • NodeJS: v14.15.3
馃彔 Reanimated2 馃悶 Bug

All 18 comments

Issue validator - update # 1

Hello!
Congratulations! Your issue passed the validator! Thank you!

Did you update the pods and reinstall the app?

Yes the issue happens on both android & IOS after upgrading & on fresh projects.

@chakrihacker yes, I just verified that again, the issue persists on ios & android,

I don't believe this is relevant, but I'm using wix's react-native-navigation is both apps.

@karol-bisztyga if a reproduce repo is needed please let me know.

Hey, I'm facing the same issue. When will it be fixed?

I think there is a problem between reanimated and react native 5. Can you someone help us?

Thanks

Hey @karol-bisztyga @hakanpinar, maybe not related but for me it was babel plugin misconfiguration (react-native-reanimated/plugin).

Found that plugin sets up _setGlobalConsole here:
https://github.com/software-mansion/react-native-reanimated/blob/fd5c6ad5524adf603a75acfda46438b4e2031a2a/plugin.js#L33-L36

Hey @karol-bisztyga @hakanpinar, maybe not related but for me it was babel plugin misconfiguration (react-native-reanimated/plugin).

Found that plugin sets up _setGlobalConsole here:
https://github.com/software-mansion/react-native-reanimated/blob/fd5c6ad5524adf603a75acfda46438b4e2031a2a/plugin.js#L33-L36

So did modifying the plugin.js work for you?

So did modifying the plugin.js work for you?

No, I mean plugin should be configured in your babel.config.js (it's actually stated in the docs).

hi @a-eid do you want iOS dev job in Tambov company? Please contact t.me/sundaleek

@angrypie my react-native-reanimated/plugin exactly as you mentioned here. And also I have modified babel.config.js as per documentation. But still I ma getting the error. Any alternatives?

@Yandamuri No clue :) some ideas:

  1. You didn't mention the MainApplication.java ?
  2. Someone mention that react-native start --reset-cache soled issue.
  3. For me it was babel.config.js, there is a a lot of [[...]...], so double check.

Hi
This is a duplicate of https://github.com/software-mansion/react-native-reanimated/issues/1546
Please, read what's there(are you using expo?) and let me know if the problem's gone or not.

@angrypie

  1. I have done all changes in `MainApplication.java' as mentioned in docs.
  2. react-native start --reset-cache -- this solution didn't work for me
  3. my babel.config.js looks like this,
    module.exports = {
           presets: ['module:metro-react-native-babel-preset'],
           plugins: [[
             "babel-plugin-transform-remove-imports", {
        "test": ['react-toastify', 'exceljs']
             }
       ],
       'react-native-reanimated/plugin'
         ]
   };

Can you please correct me if I am wrong?

@karol-bisztyga I had already gone through this issue and their solutions didn't work for me. And I am not using expo

@Yandamuri config is ok. I also went through this steps to clean cache, before noticed my config issue, might be helpful.

@angrypie this is great. Now it is working fine after so much of struggle.

@a-eid @hakanpinar can you check if that works for you?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dinhmai74 picture dinhmai74  路  3Comments

dinhmai74 picture dinhmai74  路  3Comments

sa8ab picture sa8ab  路  3Comments

ShaMan123 picture ShaMan123  路  3Comments

colinux picture colinux  路  3Comments