Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: Can't find variable: _setGlobalConsole, after upgrading to -rc.2. #1640

Closed
a-eid opened this issue Jan 15, 2021 · 36 comments
Closed

Comments

@a-eid
Copy link

a-eid commented Jan 15, 2021

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
@a-eid a-eid added the Bug label Jan 15, 2021
@github-actions
Copy link

Issue validator - update # 1

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

@chakrihacker
Copy link

Did you update the pods and reinstall the app?

@a-eid
Copy link
Author

a-eid commented Jan 16, 2021

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

@a-eid
Copy link
Author

a-eid commented Jan 18, 2021

@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.

@a-eid
Copy link
Author

a-eid commented Jan 22, 2021

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

@hakanpinar
Copy link

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

@angrypie
Copy link

angrypie commented Jan 23, 2021

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:

const globals = new Set([
'this',
'console',
'_setGlobalConsole',

@ezos86
Copy link

ezos86 commented Jan 23, 2021

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:

const globals = new Set([
'this',
'console',
'_setGlobalConsole',

So did modifying the plugin.js work for you?

@angrypie
Copy link

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).

@sundaleek
Copy link

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

@Yandamuri
Copy link

Yandamuri commented Jan 25, 2021

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

@angrypie
Copy link

angrypie commented Jan 25, 2021

@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.

@karol-bisztyga
Copy link
Contributor

Hi
This is a duplicate of #1546
Please, read what's there(are you using expo?) and let me know if the problem's gone or not.

@Yandamuri
Copy link

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

@Yandamuri
Copy link

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

@angrypie
Copy link

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

@Yandamuri
Copy link

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

@karol-bisztyga
Copy link
Contributor

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

@a-eid
Copy link
Author

a-eid commented Jan 28, 2021

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

Hey sorry for the late reply, I am not sure what to check, could You please elaborate .

Thank you

@karol-bisztyga
Copy link
Contributor

@a-eid #1640 (comment)

@a-eid
Copy link
Author

a-eid commented Jan 29, 2021

@karol-bisztyga for some reason I can no longer reproduce this bug, please close this issue when appropriate, I'll report back if I encounter this again.

thank you.

@karol-bisztyga
Copy link
Contributor

Ok I see, please let me know if it happens again and I'll reopen.

@PedroBern
Copy link

@karol-bisztyga I'm facing the same issue with expo. Both in rc.1 and rc.2. Tried all the steps to clean the cache but didn't work.

@karol-bisztyga
Copy link
Contributor

@PedroBern please try rc0(explained here)

@TheUnknownMystery
Copy link

TheUnknownMystery commented May 12, 2021

_ Ok so can someone tell me how to fix this issues please i need to know the solution_

@Yandamuri
Copy link

@sauhardo2020 Have you tried this solution?

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

@TheUnknownMystery
Copy link

Yes!, I have tried this but still it is giving the same error looks like its a problem with reanimated 2 but i cant find the right solution so i need some help for this

@TheUnknownMystery
Copy link

also can you tell me if this issues is fixed in older version because i have a project i need to complete

@michaldobiezynski
Copy link

it might sound crazy but try creating a new project with npx crna --template with-reanimated2 - reanimated will work in that

@francislow
Copy link

francislow commented Jun 24, 2021

  1. delete the 'node_modules' folder
  2. run 'npm cache clean --force'
  3. run 'npm install'
  4. run 'npm start --clear-cache'

*I did this and it works for me

@TheUnknownMystery
Copy link

Thanks!!

@simranss
Copy link

I still cannot solve this issue, and I am using react-naviagtion.

@piaskowyk
Copy link
Member

It is quite strange because we removed this function more than a year ago 😅 If you still face this issue you need to clear the cache.

@valery-lavrik
Copy link

I also ran into this problem today
image

@yunesdelivery
Copy link

Eu também tive esse problema hoje imagem

How did you manage to solve it?

@valery-lavrik
Copy link

@yunesdelivery
The problem turned out to be version incompatibility
react-native-reanimated
react-native-vision-camera
react-native

To make everything work, I use the following versions:

    "react-native": "0.70.10",
    "react-native-reanimated": "^2.12.0",
    "react-native-vision-camera": "^2.15.2",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests